Forum Discussion

pcray's avatar
pcray
Frequent Visitor
8 years ago
Solved

desktop - cumulative total

Hi

Is someone able to point me in the right direction

ive created a cumulative total for the last 12 months (rolling - see image)

I would like to create a second column to show the previous 12 months (shown with yellow marker)

this would then allow me to create calculations to understand % change between the two totals

thanks

  • Hi pcray

     

    This might be close

     

    Year L12Mths Prev = 
    CALCULATE(
        [Year L12Mths]
        ,SAMEPERIODLASTYEAR('Dates'[Date])
        )
  • Hi pcray,

     

    How about this one?

    New =
    CALCULATE (
        [total],
        DATESINPERIOD (
            dates[date],
            LASTDATE ( DATEADD ( 'dates'[Date], -12, MONTH ) ),
            -12,
            MONTH
        )
    )

     

    Best Regards,

    Dale

3 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi pcray

     

    This might be close

     

    Year L12Mths Prev = 
    CALCULATE(
        [Year L12Mths]
        ,SAMEPERIODLASTYEAR('Dates'[Date])
        )
  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi pcray,

     

    How about this one?

    New =
    CALCULATE (
        [total],
        DATESINPERIOD (
            dates[date],
            LASTDATE ( DATEADD ( 'dates'[Date], -12, MONTH ) ),
            -12,
            MONTH
        )
    )

     

    Best Regards,

    Dale

  • pcray's avatar
    pcray
    Frequent Visitor

    Hi

    Is someone able to point me in the right direction

    ive created a cumulative total for the last 12 months (rolling - see image)

    I would like to create a second column to show the previous 12 months (shown with yellow marker)

    this would then allow me to create calculations to understand % change between the two totals

    thanks

    peter