Forum Discussion
Previous Years vs Current Year
Hi Steven,
is your dates column (Years[EndofYear]) in your date dimension? Is the relationship to your fact table set up correctly?
Do you have a date dimension? Is the table marked as date table?
Without any knowledge how you set up your data model, help is quite difficult. Have a look here for more info on how to use PREVIOUSYEAR() with CALCULATE:
DAX Function Reference: PREVIOUSYEAR Function (DAX)
Best regards,
Dominik Petri.
I believe you might have better luck with DATEADD, -1, year) intead of previous year.
- michellemetzger8 years agoNew Member
Be carefull with DATEADD! It will only compare similar days between the two periods. For instance, in the first year you only have records on 200 days and the current you have records on 260 days. Using DATEADD will ignore the records that happened on days not present in the prior period.
Instead, use PARALLELPERIOD(). Same syntax as DATEADD without the nasty side effect.