Forum Discussion

JulieGueho's avatar
JulieGueho
Regular Visitor
10 years ago
Solved

Modelling: how to correctly use time intelligence and Calculate?

Hi,   I'm doing classic sales report and I'm struggling to use Time Intelligence functions such as SAMEPERIODLASTYEAR, PREVIOUSMONTH, etc...   - I have a Dates table. - I have a Sales table with...
  • JulieGueho's avatar
    JulieGueho
    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]