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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Single slicer for multiple values in row

Hi all,

I have this Data set:

Chen1821_0-1628513163443.png

 

 

I would like to create a slicer that relay on col 2 (i.e. "Beer type") -  include "split" this col to unique parametes like that:

Chen1821_0-1628512485540.png

 

Therfore I tried to copy this table and create split option via Text.split in the M query - however I didn't recvied any desirable results becuase it's not fit to the details from my original table.

Actually I would like to create slicer as above but I want to filter it with the original values i.e. if I click on "A" I would like to see the results as below (highlighted in yellow):

 

Chen1821_2-1628512847621.png

 

 

This is possible?

I really appriciate your help with it.

Thanks a lot!



1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

You can achive it by following below approach:-

1. Duplicate your table

Samarth_18_0-1628519208084.png

2. Remove other two columns from duplicate table

Samarth_18_1-1628519251280.png

3. Now split column by delimeter and in advance option select split into rows

Samarth_18_3-1628519435132.png

 

4. You will see below result

Samarth_18_4-1628519462674.png

5. Now remove duplicate and clikc on close & apply

6. Now add types from new duplicate table into slicer and other details from your table in table visual.

Samarth_18_5-1628519801234.png

7. Create a measure for filtering your table based on selection from slicer with below code and used it as visual level filter

_Filter = 
IF (
    CONTAINSSTRING (
        MAX ( 'Beer Data'[Type] ),
        SELECTEDVALUE ( 'Beer Data_duplicate'[Type] )
    ),
    1,
    0
)

 

Samarth_18_6-1628520199309.png

 Once you follow above steps it will work as expected:-

 

Samarth_18_7-1628520279938.png

 

Thanks,

Samarth

 

 

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see attachment), please check whether that is what you want.

Power Query Editor:

1. Duplicate the column "Type" name as "nType"

2. Split the new column "nType" into rows by delimiter ";#"

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("RYs7CsAgEAWvErQV3u6aYIKVn5xCLL1A7l9ETcDi8WCGKUXF1p4tKKOC17GfkBBYwKqa3w6c+vi6LHYcywyaZ0QCh3OZQaPX+cscmGBp6XuEXqfZsoVAelxf", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Beer name" = _t, Type = _t, Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Beer name", type text}, {"Type", type text}, {"Date", type date}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Type", "nType"),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Duplicated Column", {{"nType", Splitter.SplitTextByDelimiter(";#", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "nType"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"nType", type text}})
in
    #"Changed Type1"

 

yingyinr_0-1628659070567.png

3.  Create a slicer with new column "nType"yingyinr_1-1628659412448.pngBest Regards

Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

You can achive it by following below approach:-

1. Duplicate your table

Samarth_18_0-1628519208084.png

2. Remove other two columns from duplicate table

Samarth_18_1-1628519251280.png

3. Now split column by delimeter and in advance option select split into rows

Samarth_18_3-1628519435132.png

 

4. You will see below result

Samarth_18_4-1628519462674.png

5. Now remove duplicate and clikc on close & apply

6. Now add types from new duplicate table into slicer and other details from your table in table visual.

Samarth_18_5-1628519801234.png

7. Create a measure for filtering your table based on selection from slicer with below code and used it as visual level filter

_Filter = 
IF (
    CONTAINSSTRING (
        MAX ( 'Beer Data'[Type] ),
        SELECTEDVALUE ( 'Beer Data_duplicate'[Type] )
    ),
    1,
    0
)

 

Samarth_18_6-1628520199309.png

 Once you follow above steps it will work as expected:-

 

Samarth_18_7-1628520279938.png

 

Thanks,

Samarth

 

 

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

amitchandak
Super User
Super User

@Anonymous , My suggestion would be to split the row based on ;# in power query

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 
I did it but it's not working becuse the split option is not includt the next parameters overthere.

I create two table - one is the Original table with the Original details as above

The second table is with the split option:

Chen1821_0-1628513668448.png


I want to see my original table in the dashboard. therfore I create a relationship between them.

However when I click on some letter I don't get what I want to see:

Chen1821_1-1628513789121.png

 

Thanks in advanced!

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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