Forum Discussion

minimynt's avatar
minimynt
Frequent Visitor
10 years ago
Solved

DAX Last Year Sales

Hi,   I want to create LY Sales calculation, but somehow there's something wrong with the result. The total of LY Sales is right, but I don't have any idea why LY sales for each year is not showin...
  • Anonymous's avatar
    Anonymous
    10 years ago

    Hello, try this instead: LY Sales = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Orders'[Order Date]))

     

    If you have a dedicated date table, you'll want to use the date column from there instead of Order Date

  • minimynt's avatar
    minimynt
    10 years ago

    Anonymous Hi, I've also tried with SAMEPERIODLASTYEAR but the result is the same. However, I just figured out that only continuous date is valid for this case and my OrderDate isn't continuous so that's why.

     

    Thanks anyway! :)