Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Moving Average Column Per Category

Need DAX formula to get the MOVING AVG PER CATEGORY column (highlighted in green)   The result is average of top rows of a category i.e., Category A:    Row 2 is average of EMP HEADCOUNT 314, 317...
  • Fowmy's avatar
    5 years ago

    Anonymous 

    Add the following code as a new table:

    Moving Average = 
    
    CALCULATE(
        AVERAGE(Table1[EMP HEADCOUNT]),
        Table1[MONTH] <= EARLIER(Table1[MONTH]),
        ALLEXCEPT(Table1,Table1[CATEGORY])
    )

     

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn