Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
srlabhe
Resolver III
Resolver III

Selecting Multiple values in Measure Filter

Hi PBI Gurus

I have below measure created which has o/p as text values

 

varMeasRMAssignDiff =
VAR _StartExists = [varExistsatStart] > 0
VAR _EndExists = [varExistsatEnd] > 0
VAR _StartKey = [varKeyAtStart]
VAR _EndKey = [varKeyAtEnd]
VAR _RMlogin=SELECTEDVALUE(LOGIN_ID)
RETURN

SWITCH (
TRUE(),
--- if RM Login is Empty
ISBLANK(_RMlogin)=TRUE() ,
 "Not Found",

-- Present in both and unchanged
_StartExists && _EndExists && (ISBLANK(_StartExists)=FALSE() && ISBLANK(_EndExists)=FALSE()),
"No changes",

NOT _StartExists && NOT _EndExists,
"No changes",

-- Record added in End Snapshot
NOT _StartExists && _EndExists,
"newly assigned",

-- Record removed from End Snapshot
_StartExists && NOT _EndExists,
"unassigned",

-- Present in both but data changed
_StartExists && _EndExists && _StartKey <> _EndKey,
"Modify",
BLANK()
)
 
Then I have a disconnected table 
ChangeType = DATATABLE("Change", STRING, { {"No risk managers found for the selected desk and legal entity"}, {"No changes"}, {"RM newly assigned"}, {"Modify"},{"RM unassigned"},{"RM could be assigned but is not"} })
 
I have another measure to apply on the table visual
varIsInSelectedChange =
VAR selChange = SELECTEDVALUE( ChangeType[Change] ) // value selected in ChangeType slicer
VAR rowChange = [varMeasRMAssignDiff] // the computed change label for the row
RETURN
IF(
ISBLANK(selChange) || ISBLANK(rowChange),
1, // if no change selected or row has no label, keep it visible
IF(rowChange = selChange, 1, 0)
)
Now when I add varMeasRMAssignDiff as filter in table visual and varIsInSelectedChange =1 ,it allow me to select single value well but when I try to select mutiple values its doesnt work the way it should.
As it keep showing data for other values too.
How to make the meausre as filter to work even for multiple values selections?
 
1 ACCEPTED SOLUTION
srlabhe
Resolver III
Resolver III

I could achieve this by changing varIsInSelectedChange to below 

varIsInSelectedChange =
VAR selectedChanges = VALUES( ChangeType[Change] ) // Get all selected values as a table
VAR rowChange = [varMeasRMAssignDiff] // the computed change label for the row
RETURN
IF(
    ISBLANK( rowChange ),
    1, // if row has no label, keep it visible
    IF(
        ISEMPTY( selectedChanges ),
        1, // if no selection in slicer (slicer is empty), all rows are visible
        IF(
            rowChange IN selectedChanges, // Check if the row's change label is within the selected list
            1,
            0
        )
    )
)

View solution in original post

1 REPLY 1
srlabhe
Resolver III
Resolver III

I could achieve this by changing varIsInSelectedChange to below 

varIsInSelectedChange =
VAR selectedChanges = VALUES( ChangeType[Change] ) // Get all selected values as a table
VAR rowChange = [varMeasRMAssignDiff] // the computed change label for the row
RETURN
IF(
    ISBLANK( rowChange ),
    1, // if row has no label, keep it visible
    IF(
        ISEMPTY( selectedChanges ),
        1, // if no selection in slicer (slicer is empty), all rows are visible
        IF(
            rowChange IN selectedChanges, // Check if the row's change label is within the selected list
            1,
            0
        )
    )
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors