Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Moving Avg Calculation

Hi,

I am trying to calculate moving Average for the below data:

I greatly appreciate some help in DAX script.

I do not have any Date/Calender table.

 

Thanks

1 Reply

  • smpa01's avatar
    smpa01
    Community Champion
    Running Average Measure = DIVIDE(CALCULATE(
        SUM('Table1'[10 Week]),
        FILTER(
            ALLSELECTED('Table1'[Date]),
            ISONORAFTER('Table1'[Date], MAX('Table1'[Date]), DESC)
        )
    ),
    CALCULATE(
        COUNTA('Table1'[10 Week]),
        FILTER(
            ALLSELECTED('Table1'[Date]),
            ISONORAFTER('Table1'[Date], MAX('Table1'[Date]), DESC)
        )
    )
    )