Forum Discussion
Filter by a Measure
- 1 year ago
jcastr02 There is an improved version of your measure that ensures only the latest week's data is displayed:
HTS Category_For Matrix =
VAR _maxweek =
CALCULATE(MAX('Table'[Week]), ALL('Table'))
RETURN
IF(
SELECTEDVALUE('Table'[Week]) = _maxweek,
MAX('Table'[HTS Category New]),
BLANK()
)And then create a new measure to identify the latest week:
LatestWeekFlag =
VAR _maxweek =
CALCULATE(MAX('Table'[Week]), ALL('Table'))
RETURN
IF(MAX('Table'[Week]) = _maxweek, 1, 0)Add the LatestWeekFlag measure to your matrix visual.
Set the filter condition to show only where LatestWeekFlag is 1.
jcastr02 There is an improved version of your measure that ensures only the latest week's data is displayed:
HTS Category_For Matrix =
VAR _maxweek =
CALCULATE(MAX('Table'[Week]), ALL('Table'))
RETURN
IF(
SELECTEDVALUE('Table'[Week]) = _maxweek,
MAX('Table'[HTS Category New]),
BLANK()
)
And then create a new measure to identify the latest week:
LatestWeekFlag =
VAR _maxweek =
CALCULATE(MAX('Table'[Week]), ALL('Table'))
RETURN
IF(MAX('Table'[Week]) = _maxweek, 1, 0)
Add the LatestWeekFlag measure to your matrix visual.
Set the filter condition to show only where LatestWeekFlag is 1.
bhanu_gautam THANK YOU!!!! this worked!