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
Anonymous
Not applicable

Powerbi Hierarchy Dax

Hi Team 


IsInHierarchyChain =
VAR SelectedName =
SELECTEDVALUE(AllCertsWithWSRHierarchy[L1_displayname]) -- The selected name in slicer
VAR CurrentChain =
CONCATENATEX({
MAX(AllCertsWithWSRHierarchy[L1_displayname]),
MAX(AllCertsWithWSRHierarchy[L2_displayname]),
MAX(AllCertsWithWSRHierarchy[L3_displayname]),
MAX(AllCertsWithWSRHierarchy[L4_displayname]),
MAX(AllCertsWithWSRHierarchy[L5_displayname]),
MAX(AllCertsWithWSRHierarchy[L6_displayname]),
MAX(AllCertsWithWSRHierarchy[L7_displayname]),
MAX(AllCertsWithWSRHierarchy[L8_displayname]),
MAX(AllCertsWithWSRHierarchy[L9_displayname]),
MAX(AllCertsWithWSRHierarchy[L10_displayname]),
MAX(AllCertsWithWSRHierarchy[L11_displayname]),
MAX(AllCertsWithWSRHierarchy[L12_displayname]),
MAX(AllCertsWithWSRHierarchy[L13_displayname]),
MAX(AllCertsWithWSRHierarchy[L14_displayname]),
MAX(AllCertsWithWSRHierarchy[L15_displayname]),
MAX(AllCertsWithWSRHierarchy[employeeName])
}, "|")
RETURN
IF(
NOT ISBLANK(SelectedName) &&
CONTAINSSTRING(CurrentChain, SelectedName),
1,
0
)

I am using this dax formula so what I want suppose if I select anything in hierarchy slicer then the matrix visual should same for example if I select justin then in matrix justin and reportees should only show so I am using this formula and applying the setting to filter to 1 but this is not working can u help me to resolve this 

1 ACCEPTED SOLUTION
techies
Super User
Super User

Hi @Anonymous i guess you can use the PATH DAX function for this, which can show  the selected name and their reportees, and using the measure like this

 

IsInSelectedManagerHierarchy =
VAR SelectedManagerID = SELECTEDVALUE(ManagerSelector[employee_id])
RETURN
IF (
    NOT ISBLANK(SelectedManagerID),
    IF (
        CONTAINSSTRING(
            MAX(datas[HierarchyPathh]),
            "|" & SelectedManagerID & "|"
        ),
        1,
        0
    ),
    0
)
 
please share pbix file sample if possible
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

View solution in original post

4 REPLIES 4
v-saisrao-msft
Community Support
Community Support

Hi @Anonymous,

 

We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.

 

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @Anonymous,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @Anonymous,
I wanted to check if you had the opportunity to review the information provided by @techies . Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

techies
Super User
Super User

Hi @Anonymous i guess you can use the PATH DAX function for this, which can show  the selected name and their reportees, and using the measure like this

 

IsInSelectedManagerHierarchy =
VAR SelectedManagerID = SELECTEDVALUE(ManagerSelector[employee_id])
RETURN
IF (
    NOT ISBLANK(SelectedManagerID),
    IF (
        CONTAINSSTRING(
            MAX(datas[HierarchyPathh]),
            "|" & SelectedManagerID & "|"
        ),
        1,
        0
    ),
    0
)
 
please share pbix file sample if possible
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.