Forum Discussion
DanielM16
5 years agoFrequent Visitor
SAMEPERIODLASTYEAR returns Blank
I have data that looks like this: Cut-off Date Aux_Date Category Sales 23.01.2018 01.01.2018 A 1200 24.01.2019 01.01.2019 A 8900 25.01.2020 01.01.2020 A 6400 23.01.2018...
- 5 years ago
I actually found the solution myself. Changing the measure to the following does the trick:
Sum_Sales_LY =var ly = SAMEPERIODLASTYEAR(Data[Aux_Date])return CALCULATE([Sum_Sales], all(Data[Cut-off Date]), Data[Aux_Date]=ly)
DanielM16
5 years agoFrequent Visitor
I actually found the solution myself. Changing the measure to the following does the trick:
Sum_Sales_LY =
var ly = SAMEPERIODLASTYEAR(Data[Aux_Date])
return CALCULATE([Sum_Sales], all(Data[Cut-off Date]), Data[Aux_Date]=ly)