Forum Discussion
Anonymous
2 years agoNot applicable
Previous week calculation
Hi everyone, Iam calculating the total number of previous week to have change week over week with code below, but in the result it shows same number for every weeks. PreviousWeekCount = VAR Cu...
Ahmedx
Super User
2 years agoyou need to add the following column to the calendar table and then create this measure
numweek = DATEDIFF(min('Calendar'[Date]),'Calendar'[Date],WEEK)
PreviousWeekCount =
VAR PreviosWeekOffset = MAX('CALENDAR'[numweek]) -1
RETURN
CALCULATE(
COUNT('E'[Order Number]),
FILTER(
ALL('Calendar'),
'CALENDAR'[numweek] = Previos
)
)