Forum Discussion
SAMEPERIODLASTYEAR issues Direct Query
- 6 years ago
I found a solution that seems to work.
In my date calendar I create a flag for future date column (below the formula is a video that was very helpful) :
Future Date Flag = IF(Calendar[Date] > TODAY(), "Future", "Past")
https://www.youtube.com/watch?v=XjVLaVLluYE&list=PL7GQQXV5Z8eczWqKFMDVoHMjTcpH3tgZm&index=3
I applied that as a filter for my visual card for Same Period Last Year Sales and only select "Past" (below is my measure for the value that the card displays):
Same Period Last Year = CALCULATE(SUM(Table[Sales]), SAMEPERIODLASTYEAR(Calendar[Date])
The visual works as expected even when I select a different manager. No more error...hopefully!
I found a solution that seems to work.
In my date calendar I create a flag for future date column (below the formula is a video that was very helpful) :
Future Date Flag = IF(Calendar[Date] > TODAY(), "Future", "Past")
https://www.youtube.com/watch?v=XjVLaVLluYE&list=PL7GQQXV5Z8eczWqKFMDVoHMjTcpH3tgZm&index=3
I applied that as a filter for my visual card for Same Period Last Year Sales and only select "Past" (below is my measure for the value that the card displays):
Same Period Last Year = CALCULATE(SUM(Table[Sales]), SAMEPERIODLASTYEAR(Calendar[Date])
The visual works as expected even when I select a different manager. No more error...hopefully!