Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Previous Period Calculation Help

Hello,   I'm trying to write a DAX formula to get the previous year data in my table.  Currently I have the following table:     My formula for my "Test" column is:   Test = CALCULATE(su...
  • Ashish_Mathur's avatar
    7 years ago

    Hi,

     

    That formula should be written as a measure (not as a calculated column).  You may also try this measure

     

    =CALCULATE(SUM([Actual]),SAMEPERIODLASTYEAR(Calendar[CalendarDate]))

     

    In your visual, drag any/all time dimensions only from the Calendar Table.  Also, ensure that there is a relationship from the Date column of the Data Table to the CalendarDate column of the Calendar Table.

     

    Hope this helps.