Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Making a moving average backwards

Hello everyone! I Have the follow problem, I want to do a moving average backwards. for example, as the table below: Date Value 01/01/2019 10 02/01/2019 11 03/01/2019 14 04/01/2...
  • v-cherch-msft's avatar
    7 years ago

    Hi Anonymous 

    You may create a measure like below:

    Measure =
    DIVIDE (
        CALCULATE (
            SUM ( Table2[Value] ),
            FILTER ( ALL ( Table2 ), Table2[Date] >= MAX ( Table2[date] ) )
        ),
        COUNTROWS ( FILTER ( ALL ( Table2 ), Table2[Date] >= MAX ( Table2[date] ) ) )
    )
    

    Regards,

    Cherie