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 27, 2018 in Tableau by ffdfd
• 5,550 points
13,998 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 27, 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 ?

It depends whether you want to skip ...READ MORE

answered Jul 15, 2019 in Tableau by anonymous
• 33,030 points
7,697 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, 2019 in Tableau by Cherukuri
• 33,030 points
807 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 29, 2018 in Tableau by ffdfd
• 5,550 points
2,324 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
9,891 views
+2 votes
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
1,594 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 29, 2018 in Tableau by Atul
• 10,240 points
852 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP