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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Practice_PBI
Regular Visitor

Creating custom slicer

I have a column name Vehical, having values as shown.

Practice_PBI_0-1738664383551.png


I need to have a slicer in such a way that it will have two option "All Vehicals" & "Car".

if All Vehical is selected the it will show all the values from the table
and if CAR is selected the it will show the rows having values Maruti, Tata, Kia, Hyunday.

 

Thank you.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Practice_PBI ,

 

Please create a custom slicer first and then try to create a measure to filter the visual in a custom way.

Custom Slicer = {"All Vehical","Car"}

Measure:

Custom Filter = 
VAR _SELECTVALUE = SELECTEDVALUE('Custom Slicer'[Value])
RETURN
SWITCH(_SELECTVALUE,"All Vehical",1,"Car",IF(MAX('Table'[Vehical]) in  {"Maruti", "Tata", "Kia", "Hyunday"},1,0))

Add this measure into visual level filter and set it to show items when value = 1.

Result is as below.

vrzhoumsft_0-1738733151959.png

vrzhoumsft_1-1738733159853.pngvrzhoumsft_2-1738733167046.png

 

Best Regards,
Rico Zhou

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @Practice_PBI ,

 

Please create a custom slicer first and then try to create a measure to filter the visual in a custom way.

Custom Slicer = {"All Vehical","Car"}

Measure:

Custom Filter = 
VAR _SELECTVALUE = SELECTEDVALUE('Custom Slicer'[Value])
RETURN
SWITCH(_SELECTVALUE,"All Vehical",1,"Car",IF(MAX('Table'[Vehical]) in  {"Maruti", "Tata", "Kia", "Hyunday"},1,0))

Add this measure into visual level filter and set it to show items when value = 1.

Result is as below.

vrzhoumsft_0-1738733151959.png

vrzhoumsft_1-1738733159853.pngvrzhoumsft_2-1738733167046.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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