cancel
Showing results for
Did you mean:
Highlighted
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 %

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

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV

## Re: 13 Week Rolling Average Graph with Daily %

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
5 REPLIES 5
Super User IV

## Re: 13 Week Rolling Average Graph with Daily %

One method would be to create a new column like:

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

Then you could just filter <= 12

---------------------------------------

Putting square pegs in round holes since 1972.

##### I have a NEW book! DAX Cookbook from Packt
Over 120 DAX Recipes!

Proud to be a Datanaut!

Helper I

## Re: 13 Week Rolling Average Graph with Daily %

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.

Super User IV

## Re: 13 Week Rolling Average Graph with Daily %

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
Helper I

## Re: 13 Week Rolling Average Graph with Daily %

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.

Super User IV

## Re: 13 Week Rolling Average Graph with Daily %

Hi,

Regards,
Ashish Mathur
http://www.ashishmathur.com

Announcements

#### Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

#### April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

#### MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors