Forum Discussion
SamePeriodLastYear is blank
I have a dataset with column for years and another column for unemployment rate. I want to calculate the difference year over year. I tried SamePeriodLastYear but it's giving me blank output.
I have done lots of tricks to get a dates column as the original dataset didn't have a dates column but only the years column.
Please help.
It works for me. Note there was one wtone shaped bracket in the orginal formula I posted
5 Replies
- MattAllingtonCommunity Champion
Assuming you have a year column and a value column
this year = sum(table[value])
last year = calculate([this year],filter(all(table[year]),table[year]=max(table[year))-1))
- AJ007Helper I
Thanks Matt,
I will test it and let you know. Thanks again.
- AJ007Helper I
Sorry it didn't work.
This is my test data
- MattAllingtonCommunity Champion
It works for me. Note there was one wtone shaped bracket in the orginal formula I posted