Forum Discussion
Modelling: how to correctly use time intelligence and Calculate?
- 10 years ago
Thanks for your answer. I have the same error though.
MdxScript(Model) (1, 71) Calculation error in measure 'Sales'[Sales Last Year]: Function 'DATEADD' only works with contiguous date selections.
I think it doesn't work because I'm missing values for my previous year.The workaround I found was to use the filter YEAR(Today()) = Dates[Year] and YEAR(Today()) -1 = Dates[Year]
Honestly, I believe it is easier to use the DATEADD in this instance:
Sales Last Year = CALCULATE([Sales This Year] , DATEADD(Dates[Date]),-1,YEAR)
Thanks for your answer. I have the same error though.
MdxScript(Model) (1, 71) Calculation error in measure 'Sales'[Sales Last Year]: Function 'DATEADD' only works with contiguous date selections.
I think it doesn't work because I'm missing values for my previous year.
The workaround I found was to use the filter YEAR(Today()) = Dates[Year] and YEAR(Today()) -1 = Dates[Year]
- nmorneau10 years agoNew Member
Hello,
Can you explain what you mean by this?
The workaround I found was to use the filter YEAR(Today()) = Dates[Year] and YEAR(Today()) -1 = Dates[Year]
I am having the same issue where I have some days that are missing transactions and getting a the same error with every time intelligence function I use.
Thanks,
Nick