Forum Discussion
Manager Level Hierarchies with multiples in Power BI
HI All:
I have noticed a few posts on building Hiearchies based on manager level but havent had success replicating. I am attaching a sample file and I am hoping that someone can assist me. I want to be able to show all employees who role up to Liz Goode in this example. Then I would like to show all those who role up to Julie Jones and so on and so forth. The example I gave is extremely simple but I am hoping it will provide you with all you need to help me out! Thanks so much.
- Anonymous8 years ago
Hi nmck86,
You can try to use path function to get the hierarchy level, then use pathitem to create calculated columns to store different levels.
Sample:
Path = PATH('Sample'[Employee Source ID],'Sample'[Manager Source ID])Different level formula:
level 1 = PATHITEM([Path],1) level 2 = PATHITEM([Path],2) level 3 = PATHITEM([Path],3) level 4 = PATHITEM([Path],4) level 5 = PATHITEM([Path],5)
Create custom hierarchy:
Reference link:
Regards,
Xiaoxin Sheng
5 Replies
- nmck86
Post Patron
Employee Source ID Manager Source ID Employee Name Manager Name Manager Level Code Manager Level Name 1234 1109 Julie Jones Liz Goode 2 SVP 1109 Liz Goode 1 CEO 8264 1234 Carlye Boyze Julie Jones 3 VP 6483 8264 Chuck Tart Carlye Boyze 4 Director 7383 6483 Nic Brown Chuck Tart 5 Individual Contributor 8130 8264 Michelle Bobby Carlye Boyze 4 Director 7 8130 Peter Sherry Michelle Bobby 5 Individual Contributor 7402 Timm Abosh 5 Individual Contributor - AnonymousNot applicable
Hi nmck86,
You can try to use path function to get the hierarchy level, then use pathitem to create calculated columns to store different levels.
Sample:
Path = PATH('Sample'[Employee Source ID],'Sample'[Manager Source ID])Different level formula:
level 1 = PATHITEM([Path],1) level 2 = PATHITEM([Path],2) level 3 = PATHITEM([Path],3) level 4 = PATHITEM([Path],4) level 5 = PATHITEM([Path],5)
Create custom hierarchy:
Reference link:
Regards,
Xiaoxin Sheng
- Niep2000Regular Visitor
Hi There I am trying this in power BI desktop but am getting the following error Expression ErrorL The name 'PATH' wasn't recognized. Make sure it is spelled correctly.
Its almost like the function doesn't exist in power BI desktop?
- Niep2000Regular Visitor
Hi There I am trying this in power BI desktop but am getting the following error Expression ErrorL The name 'PATH' wasn't recognized. Make sure it is spelled correctly.
Its almost like the function doesn't exist in power BI desktop?
- AnonymousNot applicable
Hi,
If I have a table that contains like 150 project managers but not the names of their subordinates and that I have a RLS that allows these managers to only see their projects how would I create a hierarchy that would allow access to the managers' assistants to their managers' project ?
Thanks you in advance !