Forum Discussion

nmck86's avatar
nmck86
Icon for Post Patron rankPost Patron
8 years ago
Solved

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.

 

 

 

  • Anonymous's avatar
    Anonymous
    8 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:

    Parent-Child Hierarchies

     

    Regards,

    Xiaoxin Sheng

5 Replies

  • Employee Source IDManager Source IDEmployee NameManager NameManager Level CodeManager Level Name
    12341109Julie JonesLiz Goode2SVP
    1109 Liz Goode 1CEO
    82641234Carlye BoyzeJulie Jones3VP
    64838264Chuck TartCarlye Boyze4Director
    73836483Nic BrownChuck Tart5Individual Contributor
    81308264Michelle BobbyCarlye Boyze4Director
    78130Peter SherryMichelle Bobby5Individual Contributor
    7402 Timm Abosh 5Individual Contributor
    • Anonymous's avatar
      Anonymous
      Not 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:

      Parent-Child Hierarchies

       

      Regards,

      Xiaoxin Sheng

  • Niep2000's avatar
    Niep2000
    Regular 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?

  • Niep2000's avatar
    Niep2000
    Regular 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?

  • Anonymous's avatar
    Anonymous
    Not 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 !