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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ChrisB1977
Frequent Visitor

difference between rolling average and current month

Hi,

 

I'm trying to calculate a percentage difference between a last calendar month total and a rolling 6 month average for the same figure. I have a table that contains dates and website hits as columns, and would like to show the following in my dashboard:

 

'Website hits for previous calendar month' (I'm using relative date filtering to show the value from the last calendar month)

'Website hits - rolling 6 month average' (also displayed using relative date filtering to get last 6 calendar months)

% difference between 'website hits - rolling 6 month average' and 'website hits for previous calendar month

 

I've tried using a % difference quick measure, but this only seems to allow me to calculate the difference between an aggregate of the website hits - I can't apply the correct date filter to return the value I need.

 

Any help would be most welcome!

 

Chris

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

Hi@ sdas028

You can try to use these three measure as below:

previous calendar month = CALCULATE(SUM(Table1[Qty]),PREVIOUSMONTH('Date'[Date]))

rolling 6 month average = CALCULATE(AVERAGE(Table1[Qty]),DATESBETWEEN('Date'[Date],DATEADD(LASTDATE('Date'[Date]),-6,MONTH),LASTDATE('Date'[Date])))

% difference = [rolling 6 month average]/[previous calendar month]

Result:

7.png

Here is demo , please try it

https://www.dropbox.com/s/wjelg4gpq3y1xno/difference%20between%20rolling%20average%20and%20current%2...

 

 

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

Hi@ sdas028

You can try to use these three measure as below:

previous calendar month = CALCULATE(SUM(Table1[Qty]),PREVIOUSMONTH('Date'[Date]))

rolling 6 month average = CALCULATE(AVERAGE(Table1[Qty]),DATESBETWEEN('Date'[Date],DATEADD(LASTDATE('Date'[Date]),-6,MONTH),LASTDATE('Date'[Date])))

% difference = [rolling 6 month average]/[previous calendar month]

Result:

7.png

Here is demo , please try it

https://www.dropbox.com/s/wjelg4gpq3y1xno/difference%20between%20rolling%20average%20and%20current%2...

 

 

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you Lin, this seems to have worked!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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