Forum Discussion
cca8380
6 years agoFrequent Visitor
SAMEPERIODLASTYEAR Issues
I tried solving my issue by reviewing other post on this topic but I seem to be stuck. I am unable to get the
SAMEPERIODLASTYEAR function to work for me. Any help would be greatly appreciated.
Total_Sales = SUM(Data[Amount]) --> working great
Sales_YTD = TOTALYTD(Data[Total_Sales],'Data'[DATE]) --> working great
Sales_LYTD = CALCULATE(sum(Data[Amount]), SAMEPERIODLASTYEAR('Calendar'[Date])) --> not so much
Current Output --- Sales_LYTD same as Sales_YTD... Please help!
| Year | Total_Sales | Sales_YTD | Sales_LYTD |
| 2015 | $67,878,999,619.50 | $67,878,999,620 | $67,878,999,619.50 |
| 2016 | $78,764,797,884.73 | $78,764,797,885 | $78,764,797,884.73 |
| 2017 | $91,052,871,681.36 | $91,052,871,681 | $91,052,871,681.36 |
| 2018 | $97,214,994,268.74 | $97,214,994,269 | $97,214,994,268.74 |
| 2019 | $66,070,917,033.61 | $66,070,917,034 |
2 Replies
- AnonymousNot applicable
Hi cca8380 ,
I'd like to suggest you use date function ot manually defined filter range instead to use time intelligence function, it requires a calendar table and not allow you to nest multiple time intelligence functions.
Time Intelligence "The Hard Way" (TITHW)
Regards,
Xiaoxin Sheng
- amitchandak
Super User
You can Try below DateYTD or Total YTD
Last Year YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date Filer],-12,MONTH)))Also in one calculation, you are passing data[date] another one calendar date. Just check the join is correct.