Forum Discussion
hungry_learner
1 year agoFrequent Visitor
Rolling Average Issues
Hi All, im new to Power BI and facing below issue. im trying to calculate rolling average but somehow its not working with the measure i have created. Sample data as follows: Date Month Y...
Anonymous
1 year agoNot applicable
Thanks for the reply from rajendraongole1, please allow me to provide another insight.
Hi hungry_learner ,
Please try the following measure.
Running average =
VAR currentDate =
MAX ( 'Table'[Date] )
RETURN
CALCULATE (
AVERAGE ( 'Table'[Value] ),
'Table'[Date] <= currentDate
&& 'Table'[Date] > EDATE ( currentDate, -36 ),
ALLSELECTED ( 'Table'[Country] )
)
The result when no country is selected is as follows.
The result of selecting a country is as follows.
Please see the attached pbix for reference.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.