Forum Discussion
Lino
8 years agoFrequent Visitor
Current Year vs Previous Year
Hello everyone I have a table that contains two fields: Date Amount This table contains data of 2016, 2017 and 2018. My scope is creating a measure called Amount PY using DAX. For ...
- 8 years ago
You must use SAMEPERIODLASTYEAR() instead of PREVIOUSUEAR(), because the last one returns ALL dates from the last year, and you need the same day shifted one year back (Using SAMEPERIODLASTYEAR()).
Regards!
Lino
8 years agoFrequent Visitor
Hello Johanno
Thank you for the suggestion, but it does not work.
First Case
Second Case
In the First Case no value is showed, while in the Second Case it returns the total of the previous year basing on the year of the Date field.
For each day of the Date field, it should return the Amount of the same day in the previous year.
Regards
Lino
Johanno
Continued Contributor
8 years agoI think you need a separate date table for this to work, I can only see one table. Then you have to create a relationship between the two date columns.
- Lino8 years agoFrequent Visitor
Johanno wrote:
I think you need a separate date table for this to work, I can only see one table. Then you have to create a relationship between the two date columns.
Yes, this is the workaround that I already implemented, and it works, but I am loooking for a way using a single table.