Forum Discussion
SAMEPERIODLASTYEAR returns bank
- Anonymous8 years ago
Hi
It's because your Slicer is using a calculated column and your measure for Same period last year is using another column.
The sameperiodlastyear function must use the same column that you are filtering with your slicer.
Thank you for answering so quickly.
W
hen I select no YEAR from the Slicer, it works just perfectly, but when a YEAR is selected, the LY values are blank
Below you can see a screenshot of the Date table :
- Anonymous8 years agoNot applicable
For the Slicer I used :
Year = YEAR('Date'[FullDateAlternateKey])Now that I replace the slicer with FullDateAlternateKey, it is working perfectly.
But why ??:smileyfrustrated:
- Anonymous8 years agoNot applicable
Hi
It's because your Slicer is using a calculated column and your measure for Same period last year is using another column.
The sameperiodlastyear function must use the same column that you are filtering with your slicer.
- Anonymous8 years agoNot applicable
Yes, now I understand what the problem is.
Thank you for the explanation.I just wanted to have 'year' separately, and by using YEAR(date) function, the return value is an integer which can not be used in the SAMEPERIODLASTYEAR function.
The only option that I have( or I can think of) is to add a calendar to my slicer like below: