Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Previous Rolling Average from Rolling Average Quick Measure

Hi,   I've created a Rolling Average on sales using the quick measure feature on my date column. I was given the pre-defined DAX code and I amended the intervals for DateAdd function so that it ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous 

    Based on your description, you need to create a calendar table first.

    Calendar = CALENDAR(DATE(2023,1,1),DATE(2024,5,1))

    Then create a relationship between data table and calendar table.

     

    Then create a measure

    PreRM =
    CALCULATE (
        [Rolling Average All_Sales],
        DATEADD (
            'Calendar'[Date],
            - MAX ( 'Dynamic Rolling Average'[Dynamic Rolling Average Value] ),
            MONTH
        )
    )
    

    Then put the date column of calendar table  and the measure to the visual.

     

    Output

     

     

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.