Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Previous interval date not working

Hi,   I am trying to create a measure that returns the previous year's value, using the following expression:    Previous Year Value = CALCULATE([Total Value], DATEADD('Table'[Year],-1,YEAR ) ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Mike,

     

    The YEAR column in 'Table' has years 2011 - 2022 formatted as date.

     

    Sample data here:

     

     

     

    I've just created a DimDate table using a simple 

    DimDate = SUMMARIZE('Sheet1 (2)','Sheet1 (2)'[Year])

    and have used the Year column in DimDate in the DATEADD expression, this seems to have solved the problem.

     

    However, I am confused as to why using the Year column in DimDate as opposed to Year column in the original Table made a difference - they were both formatted as date so what was the issue?