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
atpbi10
Helper I
Helper I

Custom slicer with multiple conditions

I have data table in this form:

 

 

A           B

Val1     Top10

Val2     Top10

Val3     Top25

Val4     Top50

Val5    Other

 

 

 

How can I create custom slicer than will allow me to filter the table using B column (Top10, Top25, Top50, Other), but also when I select Top50 I also select Top25 and Top10 values, and when Top25 I select aslo Top10? 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @atpbi10 ,

 

Please create a new table in Power Query Editor:

 

let
    Source = Table.SelectColumns(Table, "B"),
    #"Added Custom" = Table.AddColumn(Source, "SelectValue", each Table[B]),
    #"Expanded SelectValue" = Table.ExpandListColumn(#"Added Custom", "SelectValue"),
    #"Removed Duplicates" = Table.Distinct(#"Expanded SelectValue"),
    #"Filtered Rows" = Table.SelectRows(#"Removed Duplicates", each ([SelectValue] <= [B] and ([B] = "Other" or [SelectValue] <> "Other")))
in
    #"Filtered Rows"

vkkfmsft_0-1648785254051.png

 

Then create a relationship in 'Slicer'[SelectValue] and 'Table'[B].

 

vkkfmsft_1-1648785327464.pngvkkfmsft_2-1648785345126.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-kkf-msft
Community Support
Community Support

Hi @atpbi10 ,

 

Please create a new table in Power Query Editor:

 

let
    Source = Table.SelectColumns(Table, "B"),
    #"Added Custom" = Table.AddColumn(Source, "SelectValue", each Table[B]),
    #"Expanded SelectValue" = Table.ExpandListColumn(#"Added Custom", "SelectValue"),
    #"Removed Duplicates" = Table.Distinct(#"Expanded SelectValue"),
    #"Filtered Rows" = Table.SelectRows(#"Removed Duplicates", each ([SelectValue] <= [B] and ([B] = "Other" or [SelectValue] <> "Other")))
in
    #"Filtered Rows"

vkkfmsft_0-1648785254051.png

 

Then create a relationship in 'Slicer'[SelectValue] and 'Table'[B].

 

vkkfmsft_1-1648785327464.pngvkkfmsft_2-1648785345126.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

truptis
Community Champion
Community Champion

Hi @atpbi10 ,
This video might help you:
https://www.youtube.com/watch?v=QtEt-QI3oe4 

Please hit the thumbs up if it does. Thanks.

No it doesnt sovle the problem. I already ranked the values according to my internal algorithm using Python. They have the labels in B column, I need a custom slicer/filter that can accept multiple conditions.

Someting like SWITCH but I dont know how to make it work.

Samarth_18
Community Champion
Community Champion

Hi @atpbi10 ,

 

Correct me if I am wrong, you want multi select in your slicer? if yes then you need to enable below property of slicer and if you want multiselect without pressing CTRL then you can enable show "select all" option

Samarth_18_0-1648535544653.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

No, I want to create a custom slicer/measure that allows me to create custom selection. 
So in the slicer I would have the option "Top 25" that will select all values that have "Top 25" and "Top 10" in column B.

 

It is not multi select I need a custom select.

 

Currently in slicer when I select Top25 only one row is shown in my example. it should show 3 rows (both top10 and top25)

 

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.