Thanks, Brian, I have tried this and it doesn’t work.
I assume because there are no dates for this week in the current year.
I did upload a sample pbix file, are you able to see this?
I think I got you most, but not all, of the way down the road to the solution you’re looking for. If you look at my revised Net Sales LY measure, I believe it’s returning the correct values for all FYs and FPs now (yours goes sideways after the leap week).
Net Sales LY Revised =
VAR CurrFY = SELECTEDVALUE( Dates[FiscalYear] )
VAR Result =
CALCULATE(
[Net Sales],
FILTER(
ALL( Dates[FiscalYear], Dates[FiscalYearName], Dates[FiscalPeriod]),
Dates[FiscalYear] = CurrFY - 1
)
)
RETURN Result
The one thing I just can’t get to work is having the leap week show up in the Net Sales LY Revised column, even though the total for that FP is now correct.
I hope this is helpful. Full solution file attached.
Thanks Brian - that’s a lot of help. The leap week not showing up is really frustrating and has caused me many wasted hours - I can’t accept there isn’t a way? Or maybe I’m just too stubborn.
I hear you. Let me take a fresh look at it in the morning and see if I can crack it. If not, I’ll kick it to the expert team and see if one of them can.
If the relationship in either measure is inactive, it forces the fifth row to remain. Even though both measures turn the inactive relationship on via USERELATIONSHIP, the visual treats them independently so while both measures are calculated correctly, the visual acts as though the relationship in one of the measures is turned off, thus materializing the fifth row.
I hope this gets you what you need. Full revised solution file attached below.