Forum Discussion
EvanWright
9 years agoRegular Visitor
Moving Average Measure
Hello, I need help with a Moving Average. I have read through many of the other messages, but I can't seem to get this one to work. I need to know the moving average of the Count by Steam,Target ...
- 9 years ago
Try this measure. I've assumed your table is called 'Stream' and this calculates for 3 weeks (the -21 days)
Moving Average = AVERAGEX( DATESINPERIOD( 'Stream'[WeekStart], LASTDATE('Stream'[WeekStart]) , -21 , DAY), CALCULATE(sum('Stream'[Count])) )
Phil_Seamark
9 years agoMicrosoft Employee
Try this measure. I've assumed your table is called 'Stream' and this calculates for 3 weeks (the -21 days)
Moving Average =
AVERAGEX(
DATESINPERIOD(
'Stream'[WeekStart],
LASTDATE('Stream'[WeekStart]) ,
-21 ,
DAY),
CALCULATE(sum('Stream'[Count]))
)