Forum Discussion

misano's avatar
misano
Frequent Visitor
8 years ago
Solved

Issue with TotalYTD and Sameperiodelastyear

Hi   I struggled with the "Function SAMEPERIODLASTYEAR expects a contiguous selection" error and found a lot of help on this site, but have a new issue. For some reason the formula for last year re...
  • misano's avatar
    misano
    8 years ago

    That solved the problem. I now get the values I want.

     

    Thank you.

     

    The set-up is now as follows:

    Totalsalg YTD = TOTALYTD([Totalsalg];DATESYTD(Dates[Date]))

    Totalsalg LYTD = CALCULATE([Totalsalg YTD];SAMEPERIODLASTYEAR('Dates'[Date]))

     

    And I needed something to filter the year. Both a slicer that selects year or a matrix with year as rows works and gives me the YTD values. When adding a slicer that select Month of Year to-from I also get the eyar to date values from previous years.