Forum Discussion
jayjay0306
Helper III
6 years agoRolling average last 3 months
Hi, I hope you can help me with a shallange: I have a Power BI report, where I need to make a measure (I don't have access to the source table) which calculates the rolling average for the last 3 m...
- Anonymous6 years ago
How about this?
Rolling Average 3 months = VAR LastDate_ = LASTDATE ( Table[Calendar Day] ) RETURN CALCULATE ( AVERAGEX ( VALUES ( 'Table'[Month] ); CALCULATE ( SUM ( 'Table'[Sales] ) ) ); FILTER ( ALL ( Table ); [Calendar Day] <= LastDate_ && [Calendar Day] > DATEADD ( LastDate_; -3; MONTH ) ) )Similar to yours, but i changed the table for AVERAGEX to iterate over to the month values. Also changed the calcualte filter a little bit.
- 6 years ago
Excellent Ulf, that solved it 🙂
Thanks.
Greg_Deckler
Community Champion
6 years agoI wrote this, Rolling Months Quick Measure: https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Months/m-p/391499#M124
Also, if that doesn't work, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
jayjay0306
Helper III
6 years agoHi Greg,
thanks for your input. much appreciated. The solution didn't quite solve my problem, but I got wiser on DAX. 🙂