Forum Discussion
Elina_Mirin
2 years agoAdvocate II
Current Week versus Same Week Last Year
Hello all, I am trying to create a custom measure in order to get same week from last year. I work with US calendar and every week restarts on Sunday. Also some years have 52 weeks, others have 5...
- 2 years ago
MeasureSameWeekLastYear = //Try this one might help you VAR CurrentYearWeek = CONCATENATE(MAX('YourTable'[Year]), "-", MAX('YourTable'[WeekNumber])) VAR PreviousYearWeek = CONCATENATE(MAX('YourTable'[Year]) - 1, "-", MAX('YourTable'[WeekNumber])) RETURN CALCULATE( [YourMeasure], FILTER( ALL('YourTable'), 'YourTable'[YearWeek] = PreviousYearWeek ) )
Elina_Mirin
2 years agoAdvocate II
Hi! Quick update on this topic. The measure is working - I just have updated a little bit. I have directly used a column from my calendar table in the variables - I did not use "Concatenate".
Thanks for your help!