Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

12 months rolling doesn't work

I have a dataset containing only Cumulative Amounts for each period, like so:   Period AC/BU/FC ScenarioYear Amount 1 AC 2021             100 2 AC 2021             210 3 AC 2...
  • v-yanjiang-msft's avatar
    4 years ago

    Hi Anonymous ,

    According to your description, Month is a measure you created, so you can't use it in the SUM function which only accepts columns as parameter.

    I create a sample and here's my solution, use the DATESINPERIOD and SUMX functions.

    Create a measure.

    EUR LTM =
    SUMX (
        DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), -12, MONTH ),
        'Table1'[Month]
    )
    

    Get the correct result.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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