I have a data warehouse. DimDate is connected to FactCost by datekey. The relationship is many to one and the cross filter direction is single.
I have defined YTD Cost measure:
YTD Cost = TOTALYTD(sum(Cost[Amount]),'Date'[DateKey])
and then YTD last year
LY YTD = CALCULATE([YTD Cost], SAMEPERIODLASTYEAR(Cost[DateKey]))
When I try to plot YTD last year I get the following error message:
MdxScript(Model) (1,53) Calculation error in measure 'Cost'[LY YTD]: Function 'SAMEPERIODLASTYEAR' only works with contiguous date selection.