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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
andre2x
Frequent Visitor

Filter Multiple Columns with Hierarchy Slicer

Hi, I am looking to multiple columns from the same table, with a single nested hierarchical slicer. The slicer is a 3 level filter containing Divison -> Area -> Cohort, with Cohort being the lowest level. In the table, I have records with an Owner and an Originator, and I've brought in their respective Divisions, Areas, and Cohorts. For the selected value in the slicer, records with an Owner OR Originator that match the selected value should be shown.

 

IDOwner_DivisionOwner_AreaOwner_CohortOriginator_DivisionOriginator_AreaOriginator_Cohort
1abcdef
2dxyaxy

 

For example, I'd like for the user to be able to select Division A, then rows 1 and 2 are displayed. If the user then drills down and selects Area B, only row 1 will be displayed, etc.

Please let me know if you have any questions and thanks in advance!

1 ACCEPTED SOLUTION
ajaybabuinturi
Solution Sage
Solution Sage

Hi @andre2x ,

I would like to suggest to follow below steps to get expected results.
Step1: Create HierarchyTable using below DAX

HierarchyTable = 
UNION(
    SELECTCOLUMNS(Data, "Division", Data[Owner_Division], "Area", Data[Owner_Area], "Cohort", Data[Owner_Cohort]),
    SELECTCOLUMNS(Data, "Division", Data[Originator_Division], "Area", Data[Originator_Area], "Cohort", Data[Originator_Cohort])
)

Step2: Create IsInScope measure for selected Division, Area and Chort. It ensures that whether the selected values are in scope or not.

IsInScope = 
Var SelectedDivision = SELECTEDVALUE(HierarchyTable[Division])
Var SelectedArea = SELECTEDVALUE(HierarchyTable[Area])
Var SelectedCohort = SELECTEDVALUE(HierarchyTable[Cohort])
Var Result =
IF(
    -- Check if Division is selected and matches either Owner or Originator
    (
        ISBLANK(SelectedDivision) || 
        MAX(Data[Owner_Division]) = SelectedDivision || 
        MAX(Data[Originator_Division]) = SelectedDivision
    ) &&
    -- Check if Area is selected and matches either Owner or Originator
    (
        ISBLANK(SelectedArea) || 
        MAX(Data[Owner_Area]) = SelectedArea || 
        MAX(Data[Originator_Area]) = SelectedArea
    ) &&
    -- Check if Cohort is selected and matches either Owner or Originator
    (
        ISBLANK(SelectedCohort) || 
        MAX(Data[Owner_Cohort]) = SelectedCohort || 
        MAX(Data[Originator_Cohort]) = SelectedCohort
    ),
    1, -- Show row if conditions match
    0  -- Hide row otherwise
)
RETURN
Result

Step3: Add the Division, Area and Chort values to the visual and add IsInScope to the filter pane and set the value is 1.

ajaybabuinturi_0-1743649583388.png

By using above approach you will get the desired output. Also I am attching .pbix file for your reference.
https://drive.google.com/file/d/1LMc_P0aEqhC7VpNntRFlkPmZqP8jZIZk/view?usp=drive_link 

Thanks,

If the solution helps, please Like👍 and mark it as Accepted Solution so it may help others, if anyone facing same questions/issues.

View solution in original post

3 REPLIES 3
ajaybabuinturi
Solution Sage
Solution Sage

Hi @andre2x ,

I would like to suggest to follow below steps to get expected results.
Step1: Create HierarchyTable using below DAX

HierarchyTable = 
UNION(
    SELECTCOLUMNS(Data, "Division", Data[Owner_Division], "Area", Data[Owner_Area], "Cohort", Data[Owner_Cohort]),
    SELECTCOLUMNS(Data, "Division", Data[Originator_Division], "Area", Data[Originator_Area], "Cohort", Data[Originator_Cohort])
)

Step2: Create IsInScope measure for selected Division, Area and Chort. It ensures that whether the selected values are in scope or not.

IsInScope = 
Var SelectedDivision = SELECTEDVALUE(HierarchyTable[Division])
Var SelectedArea = SELECTEDVALUE(HierarchyTable[Area])
Var SelectedCohort = SELECTEDVALUE(HierarchyTable[Cohort])
Var Result =
IF(
    -- Check if Division is selected and matches either Owner or Originator
    (
        ISBLANK(SelectedDivision) || 
        MAX(Data[Owner_Division]) = SelectedDivision || 
        MAX(Data[Originator_Division]) = SelectedDivision
    ) &&
    -- Check if Area is selected and matches either Owner or Originator
    (
        ISBLANK(SelectedArea) || 
        MAX(Data[Owner_Area]) = SelectedArea || 
        MAX(Data[Originator_Area]) = SelectedArea
    ) &&
    -- Check if Cohort is selected and matches either Owner or Originator
    (
        ISBLANK(SelectedCohort) || 
        MAX(Data[Owner_Cohort]) = SelectedCohort || 
        MAX(Data[Originator_Cohort]) = SelectedCohort
    ),
    1, -- Show row if conditions match
    0  -- Hide row otherwise
)
RETURN
Result

Step3: Add the Division, Area and Chort values to the visual and add IsInScope to the filter pane and set the value is 1.

ajaybabuinturi_0-1743649583388.png

By using above approach you will get the desired output. Also I am attching .pbix file for your reference.
https://drive.google.com/file/d/1LMc_P0aEqhC7VpNntRFlkPmZqP8jZIZk/view?usp=drive_link 

Thanks,

If the solution helps, please Like👍 and mark it as Accepted Solution so it may help others, if anyone facing same questions/issues.

This is working for me, thank you very much! Is there a workaround to applying this as a page-level filter? Currently I am applying IsInScope = 1 individually to each visual.

ryan_mayu
Super User
Super User

@andre2x 

is this the table your sample data? what is the table for  hierarchical slicer? could you pls also provide that table?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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 Solution Authors