Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Same Period Last Year

I am using the following calculation to get the data for last year, but the values in the table are blank

 

MTD LY = CALCULATE(TOTALMTD(SUM('Month_Dataset'[Value]),'DIM_Date'[Date]),SAMEPERIODLASTYEAR('DIM_Date'[Date]))

 

Any assistance you can provide is appreciated.

Heather

1 Reply

  • Anonymous , need little bit of change

     

    Try

    MTD LY = CALCULATE(TOTALMTD(SUM('Month_Dataset'[Value]),dateadd('DIM_Date'[Date]),-1, year))

     

    or

     

    MTD LY = CALCULATE(SUM('Month_Dataset'[Value]),SAMEPERIODLASTYEAR('DIM_Date'[Date]))

     

     

    make sure DIM_Date is marked as date table

    Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw