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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bhanes22
Helper I
Helper I

Slicer with distinct values from a column that has multiple values?

Hey All,

 

I'm very much a novice when it comes to PowerBI, so please be gentle here. I have an issue where I have a column named specifications in my item master table that has multiple different specs for each item ID,

 

example: item ID - "2778-FR" has specs: FDA Approved, RGD, GFLT, etc. 

                item ID - "3489-GT" has specs: UP, Dupont Viton, Class VI, FDA Approved, etc. 

 

What I want to do is have a slicer dropdown that picks out the distinct values from this spec column and then what ever is picked from this slicer will filter the data table below it with the corresponding items that have those specifications. 

 

bhanes22_1-1622812063565.png

 

 

1 ACCEPTED SOLUTION

Hi @bhanes22 

My previous measure only deals with a single select situation. For multiple specs selections, you could use below measure and set show items when the value is greater than 0.

Flag 2 = 
CALCULATE (
    COUNTROWS ( 'master table' ),
    FILTER (
        'master table',
        SUMX (
            specifications,
            SEARCH ( specifications[spec], 'master table'[specifications], 1, 0 )
        ) > 0
    )
)

 

I found above measure from below blog, you could refer to it for more ideas.

SEARCH FUNCTION WITH A LIST VALUE - Microsoft Power BI Community

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @bhanes22 

 

You need to have all distinct spec values in a column of an independent table and use this column in a slicer. Then create below measure and drag it into the table visual's filter pane and set value is 1.

Flag = 
VAR selectedSpec = SELECTEDVALUE(specifications[spec])
VAR Specs = SELECTEDVALUE('master table'[specifications])
RETURN
IF(CONTAINSSTRING(Specs,selectedSpec),1,0)

060801.jpg

Download the attachment for details.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

This worked perfectly! Thank you so much for your help! One quick question and its not the end of the world if this is not possible but it doesn't seem to filter properly on multiple spec selections, would that be possible to filter on multiple specs? 

Hi @bhanes22 

My previous measure only deals with a single select situation. For multiple specs selections, you could use below measure and set show items when the value is greater than 0.

Flag 2 = 
CALCULATE (
    COUNTROWS ( 'master table' ),
    FILTER (
        'master table',
        SUMX (
            specifications,
            SEARCH ( specifications[spec], 'master table'[specifications], 1, 0 )
        ) > 0
    )
)

 

I found above measure from below blog, you could refer to it for more ideas.

SEARCH FUNCTION WITH A LIST VALUE - Microsoft Power BI Community

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.