Forum Discussion

RichCoutinho's avatar
RichCoutinho
Frequent Visitor
2 years ago
Solved

PATH hierarchy

Hi all,    I have in powerBI 2 tables:  - Employee Data List which conatins all info about employees  - Manager Data List, which contains the name and HRcode of employees who are managers  and t...
  • RichCoutinho's avatar
    RichCoutinho
    2 years ago

    Hi Ibendlin,

    This solution was not feasible for my client requirment. 

     

    After sleep on it, i have dicided to change the data model, so I have created: 

    1. Table 1: Employee data which has theemployee's info

    2. Table 2: Manager data which has the managers' info 

    3. Table 3: Reference table, which coained all HR code for employees, the HR code for the manager and i have created additional columns in Powequery adding the manger of the manager until the last level of managment in this case as 12 columns as we have 11 levels of hierarchy (counting with the employee). 

     

    Wiuth the table 3 in power query i have pivoted the columns into lines and filterd out the blanks cases of hierachy. 

     

    So in power BI I have used the HR code as primary key to connect Table 1: employee with the Table 3 Reference and as foreign key Manager HR code to conect Table 3 with Table 2 Manager's data. 

     

    So then with visuals i have added the managers name in the slicer giving option to search, and a table with employee info, and when i select the name of manager on the slicer it shows all employees (direct and indirect) under the maagers responsability.