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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors