Forum Discussion

mshashmi's avatar
mshashmi
Frequent Visitor
9 years ago
Solved

Moving Average changes when using a Slicer

Hi   I have a table and a measure is present to calculate moving average. I have a date slicer present too. Moving average of mine is for previous 3 weeks. So whn any date range is selected, the da...
  • Anonymous's avatar
    Anonymous
    9 years ago
    Moving Average= CALCULATE(
    	AVERAGEX(
    		lineDataClosed,
    		SUM(lineDataClosed[Closed Count])/3
    	),
    	ALL(lineDataClosed),
    	DATESINPERIOD(
    		lineDataClosed[Week],
    		LASTDATE(lineDataClosed[Week]),
    		-21,
    		DAY
    	)
    )

    Try this and let me know the result.