Forum Discussion

ShrimpCreole's avatar
ShrimpCreole
Helper I
3 years ago
Solved

Switching Between Periods Presented Using Rolling-12 Summations

I can not for the life of me figure how to write a measure where I can show rolling-12 revenue from month to month and provide the user the ability to select the period to view it in (2, 3, 5, 10 yea...
  • v-easonf-msft's avatar
    v-easonf-msft
    3 years ago

    Hi, ShrimpCreole 

    Try to enter a new table :

     

    YTD =
    CALCULATE ( SUM ( Sales[Sales Amount] ), DATEADD ( 'Date'[Date], -1, YEAR ) )
    13M =
    CALCULATE ( SUM ( Sales[Sales Amount] ), DATEADD ( 'Date'[Date], -13, MONTH ) )
    

     

    ....

    Then add a new measure like:

    New measure=
    SWITCH (
        SELECTEDVALUE ( 'Slicer Table'[Period] ),
        "YTD", [YTD],
        "13M", [13M],
        "2YR", [2YR],
        "3YR", [3YR],
        "5YR", [5YR],
    )
    

    Best Regards,
    Community Support Team _ Eason