A follow-up on implementing Like-for-Like (L4L) analysis for retail stores in Power BI, addressing a confusing edge case where PY (prior year) values were assigned to different L4L states than current-year values. The fix involves adding a second L4LKey_PY column built via a SQL cursor procedure that compares store opening/closing dates against the same-year months rather than prior-year months. The new column is linked via an additional relationship in the Power BI data model, and the DAX measure uses USERELATIONSHIP() to apply the correct L4L state when calculating PY figures, ensuring consistent state assignment across both current and prior year results.
Sort: