Forum Discussion
SAMEPERIODLASTYEAR does not work as expected
*I have posted the following before but it did not exist in my subscription. So I re-post again.
Hello,
I am trying to use the SAMEPERIODLASTYEAR formula but it seems it does not work as it is.
Last year revenue2a = CALCULATE(sum('Revenue 2017 18'[Total]),SAMEPERIODLASTYEAR('Calendar'[Date]))
The relationship between 'Calendar' table and 'Revenue 2017 18' can be seen below:
The calendar table has one formula only:
Calendar = CALENDARAUTO(3)
The 'revenue 2017 18' table has 12 rows of data only:
When I try to display the thidd column which has the formula:
"Last year revenue2a = CALCULATE(sum('Revenue 2017 18'[Total]),SAMEPERIODLASTYEAR('Calendar'[Date]))"
The column displays data in 2019 which I don't have such data at all.
Did I do anything wrong?
Thanks,
Ricky
- v-danhe-msft8 years agoMicrosoft Employee
Hi rickylee,
Could you have received the reply I sent to you before? And have you tetsed to modify your calendar table like this?
Table = CALENDAR("2017/1/1","2018/12/31")Regards,
Daniel He