Forum Discussion
Ben1981
2 years agoHelper III
Calculate value from a previous date
Hi, I'm trying to write a measure to calculate the volume from a table but for the previous week selected in the filter. So the user can select the current week but the measure will show what is i...
- 2 years ago
Ben1981 , Try using below mentioned method
VolumePreviousWeek =
VAR SelectedWeek = SELECTEDVALUE('DateTable'[Week]) - 7
RETURN
CALCULATE(
COUNT('YourTableName'[ID]),
FILTER(
ALL('DateTable'),
'DateTable'[Week] = SelectedWeek
)
)Please accept as solution and give kudos if it helps
bhanu_gautam
2 years agoSuper User
Ben1981 , Try using below mentioned method
VolumePreviousWeek =
VAR SelectedWeek = SELECTEDVALUE('DateTable'[Week]) - 7
RETURN
CALCULATE(
COUNT('YourTableName'[ID]),
FILTER(
ALL('DateTable'),
'DateTable'[Week] = SelectedWeek
)
)
Please accept as solution and give kudos if it helps
Ben1981
2 years agoHelper III
Yeah that worked, thank you! 🙂