SamePeriodLastYear returns this year selecte period value


I use very simple formula

Suma_pernai = CALCULATE([Pardavimo_suma_SF];SAMEPERIODLASTYEAR(Dates[Date]))

` But it returns same value as Pardavimo_suma_SF

Dates is date table related to transactions table where measure Pardavimo_suma_SF is calculated from.
Have You any idea how to find error?


Try using DATEADD instead of SAMEPERIODLASTYEAR. Here is one of Sam’s videos that explains this concept.


Thanks ojones, I’ve tried it. DATEADD is more flexible indeed. But it didn’t help. Reason was that in slicer I used date from Sales table in slicer. When I changed this slicer to Dates[Date] both functions DATEADD and SAMEPERIODLASTYEAR works correctly.


Yep nice one. That’s exactly what you need to do. Always use the date column from the date table.