Reputation: 728
e.g: If I have the data as below:
Week 1 Week2 Week3
S M T W T F S S M T W T F S S M T W T F S
2 5 6 7 5 5 3 4 5 7 2 4 3 2 4 5 2 1 2 7 8
If today is Monday, my average will be (5+5+5)/3 which is 5. Tomorrow it will be (6+7+2)/3 which will be 5 again and day after it will be (7+2+1)/3 which will be 3.33
How to get this in Tableau?
Upvotes: 1
Views: 2513
Reputation: 47
Data source used-: Tableau Sample Superstore.
You can do the following-: Columns-: Week(Order Date) Rows-: Weekday(Order date)
Put Sales in text. Right click sales>Quick Table Calculation>Moving Average
right click Sales>edit quick table calculation> Set the following Select Moving along-: "Table across" Previous values-: 4
Upvotes: 0
Reputation: 46
First, you can use "Weekday" as a column or row (by rightclicking on the date).
Then you can simply add a Table Calculation "Moving Average" with a specific computing dimension "Week of [Date]"
=> Table Calculation Specifics <=
=> Result <=
Upvotes: 2