How to calculate weekly average from daily data?

0 votes

Tableau 8.1.
Sample Data: 

Date     Sales
1-1-14     $5
1-2-14     $2
...
6-15-14    $15

Which can be aggregated to weeks of course

Week 1   $15
Week 2   $12
Week 3   $10
Week 4   $13

etc.

What I want?

I would like to get the weekly average of each month
Somewhat like this:

          Weekly Average
Month 1     (weekly average of the weekly total sales)  ($15+$12+$10+13)/4 = 12.5
Month 2 
Month 3 

Does that make sense? If you simply put "average" in the tableau table, it gives the average daily value PER WEEK (or month) < - I don't want that. I want the average of the weekly totals per month.

Jun 26, 2018 in Tableau by Atul
• 5,530 points
132 views

1 answer to this question.

0 votes

You can create these calculated fields:

Unique Weeks = COUNTD(DATEPART('week',[Date]))
Weekly Average = sum([Sales])/[Unique Weeks]

Then simply report Weekly Average x Month (or Quarter or Year, etc.)
(Note: Some weeks have < 7 days).

or 

simply create one calculated field.

WINDOW_AVG(SUM([Sales]))

and drag your Date pill onto the rows shelf twice, one aggregated to day, the other to week. Make sure pills are set to discrete (blue) and drag your Sales measure onto the shelf, also as discrete.

answered Jun 26, 2018 by Atul
• 10,240 points

Related Questions In Tableau

+2 votes
2 answers

How to calculate Yearly Average when few month data are missing ?

Hi, You can try by manually calculating ...READ MORE

answered Jul 31 in Tableau by raksha
71 views
0 votes
1 answer

How to get past N months date from data source?

Hi, this is a one solution to your ...READ MORE

answered Mar 1 in Tableau by Cherukuri
• 25,940 points
66 views
0 votes
0 answers

How to export the IdP (Identity provider) XML Metadata from Keycloak which is imported to Tableau?

Keycloak version 1.6.1, Goal: Keycloak should act ...READ MORE

Mar 28, 2018 in Tableau by Atul
• 5,530 points
429 views
0 votes
1 answer

How to use tableau to searh for text within entire data

You can use a pivot table in ...READ MORE

answered Apr 4, 2018 in Tableau by xyz
• 1,550 points
50 views
0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
1,822 views
+1 vote
1 answer
0 votes
1 answer

Calculated filed with if-then

Below is the required code:  IF (NOT ISNULL([test2])) ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
77 views
+2 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How can I filter data to 8 days ago?

Create a calculated field using datemath to ...READ MORE

answered Sep 28, 2018 in Tableau by Atul
• 10,240 points
51 views