Forum Discussion
SAMEPERIODLASTYEAR returns bank
- Anonymous7 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.
For the Slicer I used :
Year = YEAR('Date'[FullDateAlternateKey])Now that I replace the slicer with FullDateAlternateKey, it is working perfectly.
But why ??:smileyfrustrated:
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.
- Anonymous7 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:
- v-chuncz-msft7 years agoCommunity Support
Anonymous,
You may add ALL Function.
https://community.powerbi.com/t5/Desktop/Last-Fiscal-Year-Total-by-Month-DAX/m-p/224625#M99894