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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
srlabhe
Super User
Super User

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
Super User
Super User

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
Super User
Super User

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.