Forum Discussion

aslee's avatar
aslee
Helper I
9 years ago
Solved

Moving average over non-date values

Hi All,   I need to calculate a moving average over time, however the time is set as numerical iterations, not dates.    The average needs to be over the 2 iterations - for example, the current i...
  • Phil_Seamark's avatar
    9 years ago

    Hi aslee

     

    Please try the following calculated measure but change Table4 to the name of your table.

     

    Avg = FORMAT(
    		CALCULATE(
    			AVERAGE('Table4'[Cycle Time]),
    			FILTER(ALL('Table4'),
    					'Table4'[Iteration]>=MAX(Table4[Iteration])-1
    					&& 'Table4'[Iteration]<=MAX('Table4'[Iteration])
    			)
    			),
    			"##.0")