Forum Discussion
ChrisB1977
8 years agoFrequent 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 c...
- 8 years ago
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:
Here is demo , please try it
Best Regards,
Lin
v-lili6-msft
Community Support
8 years agoHi@ 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:
Here is demo , please try it
Best Regards,
Lin
ChrisB1977
8 years agoFrequent Visitor
Thank you Lin, this seems to have worked!