Hello All -
Having some problem wrapping my head around the SAMEPERIODLASTYEAR function. After having much difficulty actually trying to get anything but a blank value, this article helped me very much: same period last year using SAMEPERIODLASTYEAR return nothing. Surrogate keys in the date dimension table do not work with the SAMEPERIODLASTYEAR function.
However, what I am getting returned now is the entire year of sales, and that's not what I was expecting. The measure that I have is:
Sales LY = CALCULATE([Sales YTD],SAMEPERIODLASTYEAR(CalendarTable[Date]))
where the [Sales YTD] measure is:
Sales YTD = TOTALYTD(SUM(OrderItem[PriceExclTax]),CalendarTable[Date])
I assumed that SAMEPERIODLASTYEAR would filter on the [Sales YTD] measure, but it's not. Should I be including a further filter on my [Sales LY] measure?
Thanks in advance for the assistance.