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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lennythelucker
Regular Visitor

Creating a user hierarchy from a manager column to use as hierarchy slicer

Hi All,

 

I am breaking my head on this for several days now, so time to share this in the hope to get some new idea's / solution

I like to build a user hierarchy based on 1 column, The Manager column and use it in a hierarchy slicer,

 

I also want to connect this to the countries / regions slicer, so if you filter on a region, you see only the hierarchy of that region

I only want to get the hierarchy in place for the salesusers in the database

If I select a salesmanager, I want to see his data + all people in the team (under the SM in the hierarchy)

 

herunder an example of what I am trying.

hope somebody has an idea how to handle this,

 

thanks!

 

 

Picture1.jpg

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @lennythelucker,

 

You can try to use path and pathitem function to get the role hierarchy.

 

Steps:

1. Calculate column to analysis the role relationship:

Path = PATH(Role[Full Name],Role[Manager])

2.PNG

 

 

2. Add calculated columns to store the analysis relationship to original table:

First = PATHITEM([Path],1,0)
Second = PATHITEM([Path],2,0)
Third = PATHITEM([Path],3,0)
Fourth = PATHITEM([Path],4,0)

 

4.PNG

 

3. Create custom hierarchy with above columns.

5.PNG

 

 

Notice: sample table.

3.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @lennythelucker,

 

You can try to use path and pathitem function to get the role hierarchy.

 

Steps:

1. Calculate column to analysis the role relationship:

Path = PATH(Role[Full Name],Role[Manager])

2.PNG

 

 

2. Add calculated columns to store the analysis relationship to original table:

First = PATHITEM([Path],1,0)
Second = PATHITEM([Path],2,0)
Third = PATHITEM([Path],3,0)
Fourth = PATHITEM([Path],4,0)

 

4.PNG

 

3. Create custom hierarchy with above columns.

5.PNG

 

 

Notice: sample table.

3.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

THANK YOU, THANK YOU, THANK YOU!!!!!

WOW!!

 

I already tried step 1, but then went in the direction of a calculated table and got lost in my logic 🙂

This works perfectly, I am soooo happy

 

I didn t know this pathitem formula, really cool

 

again, thank you so so so so soooo much!!!!

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors