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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Practice_PBI
New Member

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 REPLY 1
v-rzhou-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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