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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
AlexplainLater
Regular Visitor

Creating a slicer for multiple Yes/No columns with a hierarchy

Hi there,

 

I am new to PowerBi and I have been asked to create a slicer which looks across multiple Yes/No column.

 

If a column has a 'Yes' value in it, the subsequent phases will also be 'Yes'. See example below with a count at the bottom

 

ProductPhase 1Phase 2Phase 3Phase 4Earliest Phase
ApplesYesYesYesYesPhase 1
BananasNoYesYesYesPhase 2
PearsNoNoYesYesPhase 3
OrangesNoNoNoYesPhase 4
KiwisYesYesYesYesPhase 1
AvacadosNoNoYesYesPhase 3
LemonsNoYesYesYesPhase 2
MelonsNoNoNoYesPhase 4
LimesYesYesYesYesPhase 1
GuavasNoNoYesYesPhase 3
COUNT35810 

 

At the moment, if I select Phase 2 on the slicer, it will only show me 2 values, but instead I would like to see 5 values (all the ones in Phase 2 and the ones in Phase 1). I've tried making a CSV column (Phase 1, Phase 2) but that looks wrong on the report.

 

Can anyone help? Please forgive my limited knowledge in this area - I'm looking for an explaination as to how this can be achieved

1 ACCEPTED SOLUTION
rohit1991
Super User
Super User

Hi @AlexplainLater ,

To create a hierarchical slicer in Power BI that filters multiple Yes/No columns while ensuring that selecting a phase includes all previous phases, you need to unpivot the phase columns and apply a custom filtering logic. First, in Power Query, unpivot the Phase 1 to Phase 4 columns so that each row represents a Product-Phase combination with a Yes/No status. Next, create a calculated column to determine the earliest phase where each product has a "Yes" value.

Then, build a Phase Hierarchy table with a corresponding Phase Order to control the filtering logic, ensuring that selecting a later phase also includes the earlier ones. Finally, create a DAX measure that filters products where their earliest phase is less than or equal to the selected phase and apply it as a visual-level filter on the table. This setup allows users to select a phase in the slicer, ensuring that all products from the selected and earlier phases remain visible, effectively implementing the desired drill-down behavior in Power BI. 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from rohit1991, please allow me to provide another insight.

Hi @AlexplainLater ,

 

Please refers to the following steps.

 

Add an index column in the Power Query editor to add a unique identifier for each row.
This way, when this index column and other columns are placed in the table visual, the other columns data will not be grouped.

vdengllimsft_0-1739844380307.png

Preventing automatic grouping in Power BI Desktop

 

A field parameter table was created using the Phase 1 and Phase 2 fields. And a slicer was created using the field parameter.

 

Create the following measure to filter values.

Measure = 
VAR selectedPhase = IF(ISCROSSFILTERED(Parameter[Parameter]),MAX('Parameter'[Parameter]),BLANK())
RETURN
IF(selectedPhase ="Phase 2",
    IF(MAX('Table'[Phase 1]) ="Yes" || MAX('Table'[Phase 2]) = "Yes",1,0),1
    )

 

Drag the index columns, field parameter into the table visual. The measure is placed in the filter of the visual and set to is 1.

This way, when you select Phase 2 in the slicer, the desired 5 values are displayed.

vdengllimsft_1-1739845018343.png

 

If you need to hide the Index column, then you need to turn off the text wrap settings for the column headers and values, and then drag the Index column to hide it.

vdengllimsft_2-1739845376078.pngvdengllimsft_3-1739845398803.png

vdengllimsft_4-1739845412887.png

 

Please see the attached pbix for reference.

 

Best Regards,
Dengliang Li

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

rohit1991
Super User
Super User

Hi @AlexplainLater ,

To create a hierarchical slicer in Power BI that filters multiple Yes/No columns while ensuring that selecting a phase includes all previous phases, you need to unpivot the phase columns and apply a custom filtering logic. First, in Power Query, unpivot the Phase 1 to Phase 4 columns so that each row represents a Product-Phase combination with a Yes/No status. Next, create a calculated column to determine the earliest phase where each product has a "Yes" value.

Then, build a Phase Hierarchy table with a corresponding Phase Order to control the filtering logic, ensuring that selecting a later phase also includes the earlier ones. Finally, create a DAX measure that filters products where their earliest phase is less than or equal to the selected phase and apply it as a visual-level filter on the table. This setup allows users to select a phase in the slicer, ensuring that all products from the selected and earlier phases remain visible, effectively implementing the desired drill-down behavior in Power BI. 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Kudoed Authors