Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
sharmon9000
Helper I
Helper I

13 Week Rolling Average Graph with Daily %

After looking at some examples previously posted, I still cant figure out how to implement this seemingly easy concept into my PowerBI report.  

 

My dataset only includes the columns: [Date], and [Success%]

 

Sample Data:

 

Date        |   Success% |
01/01/2016 | 95.12 | ............|............|
05/10/2017 | 97.49 | 05/11/2017 | 96.24 | 05/12/2017 | 95.67 | 05/13/2017 | 98.56 |
............|............|
11/24/2017 | 97.45 |

How would a rolling 13 Week Average be calculated?  It does not have to be filterable; just show the last 13 Weeks on a Line Graph Visual, like below.  I would like to show the graph below with the Daily% and 13 week Average % together.

Daily %Daily %

This seems like it would be an easy problem....just not for me :).

 

 

Any help would be greatly appreciated.

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

  1. Create a calendar table which should have all dates that exist in your dataset.  There should be no repetitions in the calendar table and no date should be missed either
  2. Create a relationship from the Date column of your data table to the date column of your calendar table
  3. In your visual, drag the date field from the calendar table
  4. Write the following measures

Success rate = SUM(Data[Success%])

13 week average success rate = CALCULATE([Success rate],DATESBETWEEN(Calendar[Date],MIN(Calendar[Date])-91,MIN(Calendar[Date])))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

  1. Create a calendar table which should have all dates that exist in your dataset.  There should be no repetitions in the calendar table and no date should be missed either
  2. Create a relationship from the Date column of your data table to the date column of your calendar table
  3. In your visual, drag the date field from the calendar table
  4. Write the following measures

Success rate = SUM(Data[Success%])

13 week average success rate = CALCULATE([Success rate],DATESBETWEEN(Calendar[Date],MIN(Calendar[Date])-91,MIN(Calendar[Date])))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for the reply.  After trying your suggestion, I still could not manage to get this to work.  When I add your new 13 weeks measure to the graph it shows the exact same as the daily % (see the inlcuded screenshot.) Your idea is exactly what I was looking for, I just cant make it work.

 

Capture.PNG

Hi,

 

Share the link from where i can download your file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

One method would be to create a new column like:

 

WeeksAgo = WEEKNUM(TODAY()) - WEEKNUM([Date])

Then you could just filter <= 12


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Thanks for the quick reply.  I was trying to calculate the 13 week Average and then display it on the same graph visual as the daily %.  This would help narrow down the dates to only show the 13 weeks, but not the average of the last 13 weeks; unless I misunderstood your usage.      

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.