Forum Discussion
PATH hierarchy
- 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.
On the Employee Table i have the the managers data as else, with this info i was able to make the Path.
I have create a second table with manager only to try to achieve what i was doing, but if there's a way to have it with only employee table which contains the managers data i'd be very happy as well.
Because when i tried to use the manager data on the slicer it was giving me only the direct reports, and i want direct and inderects.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
- RichCoutinho2 years agoFrequent Visitor
Hi ,
Here is a PBI sample of the data.
It's formed by 2 Table:
1. Employee Data List : whihc has names and data of all employees
2. Manager List: Whihc has the name of only Managers to be used in the slicer.
I want to be able to Selected the name of themanager on the Slicer and in a Table visula present hame and information of all employees under the selected manager.
I have created a Measure there called _filter hierarchy, which allowed me to achive that only when 1 manager is selected, if select 2 or manager's it soent work as expcted, it brings all employees and i want to present only employees who are below the selected managers.
Here it works well when i select one manager
error when select 2 or more managers
I believe it happens because Seelctevalue function bring only one result of selection. So I am wondering if ther's a way to achive it: indenpendent of number of managers selected to show all employees (direct and indirect reports) below the seleted managers.
- lbendlin2 years agoSuper User
Here's an alternative approach that doesn't need the Manager table.
There are other hierarchy slicers that suppress blanks in ragged hierarchies.
- RichCoutinho2 years agoFrequent Visitor
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.