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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ahmadibrahimbus
Resolver III
Resolver III

Filter slicer Based on other Slicer value

if we have a table containing three measures and we are switching between them based on button value selected.could someone help me to filter out one button based on other slicer value.So; what i would to do if the second slicer has one value I would appear these three meausures.However; if more than one value are selected I would just show two measures.

2 REPLIES 2
ahmadibrahimbus
Resolver III
Resolver III

Dear @saurabhkudale96 ,I would Thank you for your reply I really appreciate the time you spent to write the solution.I'm trying to understand how should I proceed with the above.But, before let me clarify more the requirment so it will be easier for you to confirm if the solution provided is indeed working for me.

here below is a snapshot of the idea:

ahmadibrahimbus_0-1683309920643.png

thecalculation in this table is already set up and changed according to the button selected.Now, I have a discipline slicer which is not related to the meausre table.when once discipline is selected I want to show the Qty button and hide it when more than one answer is selected.

now, could you please confirm if the above solution works for my requirment.

your support is highly appreciated.

saurabhkudale96
Frequent Visitor

Hey @ahmadibrahimbus ,

Yes, you can achieve this by using a combination of measures, buttons, and slicers in Power BI. Here are the steps you can follow:

1. Create a table that contains your three measures and the other columns that you need for filtering.

2. Create two measures to calculate the value of your two measures that you want to show when multiple values are selected in the second slicer. You can use an IF statement to check the number of selected values in the second slicer and calculate the values accordingly.

For example, if you have three measures called Measure1, Measure2, and Measure3, you can create the following two measures:
Measure2ToShow = IF(COUNTROWS(VALUES(Table2[SecondSlicerColumn])) > 1, [Measure2] + [Measure3], [Measure2])

Measure3ToShow = IF(COUNTROWS(VALUES(Table2[SecondSlicerColumn])) > 1, BLANK(), [Measure3])

The first measure will show the sum of Measure2 and Measure3 when more than one value is selected in the second slicer, and the second measure will show a blank value.

3. Create a button that changes the value of a measure that will be used to switch between the three measures. You can create a measure that uses the SWITCH function to change the measure value based on the button value.

For example, you can create a measure called SelectedMeasure that uses the following formula:
SelectedMeasure = SWITCH(TRUE(),
Table2[ButtonColumn] = "Measure1", [Measure1],
Table2[ButtonColumn] = "Measure2", [Measure2ToShow],
Table2[ButtonColumn] = "Measure3", [Measure3ToShow],
BLANK())

This measure will change the measure value based on the selected button value. When the "Measure2" button is selected and more than one value is selected in the second slicer, the measure will show the value of Measure2ToShow.

4. Create a slicer that filters the values of the second slicer column. You can use this slicer to filter the values of the second slicer column and control the visibility of the two measures that you want to hide when more than one value is selected.

5. Finally, add your measures and the button to your report, and use the slicer to filter the values of the second slicer column.

By following these steps, you should be able to filter out one button based on other slicer values.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.