SamePeriodLastYear returns this year selecte period value


#1

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?


#3

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


#4

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.


#5

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