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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Show both direct and Indirect reports based on employee selection in the slicer

Team, I need a help in creating employee hierarchy in Power BI. I have the data in my table as below.

 

Level1Level2Level3Level4
JamesChrisWilliamDavid
JamesChrisWilliamRichard
JamesChrisWilliamJoseph
JamesChrisHenryThomas
JamesChrisAlexanderCharles
JamesChrisRobertKylo
JamesBobCreedZayn
JamesBobSaintMikael
JamesBobSaintFranco
JamesBobKyeKobe
JamesBobKyeRio
JamesJohnSethErnest
JamesJohnJasonSamuel
JamesJohnJasonPerry
JamesJohnJasonJack
JamesJohnAthurAmos
JamesMarcoJaseeEric
JamesMarcoJaseeEli
JamesMarcoHawnWard


I have 4 levels of hierarchy. L1 is the highest level and L4 being the lowest level

Requirement: I should have one Employee slicer (should contains both Employees and Managerswhere I have to select the name (either employee/manager), If that employee name found in the table and that employee has any direct and indirect reporties, then I have to show those in a table in level wise as seperate columns (Level 1 is searched employee, L2 is L1's direct reports, L3 is L2's direct reports and L4 is L3's direct reports). If that employee has only 3 levels then 4th level can be blank etc.,

Ex 1: If I search for James, then I should see the above table.

Ex 2: If I search for Bob, then I should see Bob in L1 and Bob's direct reports (Creed, Saint, and Kye) in L2 and Creed, Saint, and Kye 's direct reports (Zayn, Mikael, Franco, Kobe, Rio) in L3 and if Zayn, Mikael, Franco, Kobe, Rio has any direct reports then thier direct reports should show in L4

Ex 3: If I search for Saint, then I should see Saint in L1 and Saint's direct reports (Mikael and Franco) in L2 and if either Mikael or Franco has any direct reports then those direct reports should show in L3 and so on...

Hope you get my requirement clear. Please help me with this requirement. Let me know if you need any other information. 

Thanks!

5 REPLIES 5
Anonymous
Not applicable

Team, Any help here is much appriciated. 

 

Thanks!

vojtechsima
Memorable Member
Memorable Member

Hi, @Anonymous ,
you can do following:

Use slicer and put all Levels accordingly:

vojtechsima_0-1646310104815.png

Active "Search" option by the "three dots" on the Slicer visual and expand every manager:

vojtechsima_1-1646310144913.png

Then Just Filter your name and click it (James), then you will see your table:

vojtechsima_2-1646310183733.png

Then if I clear everything out and search for "Mikael" I got the following table:

vojtechsima_3-1646310226009.png

 

Anonymous
Not applicable

Thanks @vojtechsima for your response! I'm not getting the desired result. If I select "William", I'm not getting all his direct reports, only few of them are showing and in the next level also few of the employees are missing.

@Anonymous, 
I see, well, in this case, this only works in a way that it shows everybody under the selected person, however, doesn't show people that reports to a person that selected employee reports.
@amitchandak Would you please advise how to modify this solution to achieve @Anonymous 's goal? 

Anonymous
Not applicable

Yes @vojtechsima, True. Hey @amitchandak - would be very helpful if you can see and give your view on my requirement.

 

Thanks!

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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