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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

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.