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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
josemendoza
New Member

Looking up values in multiple columns on an Organization Hierarchy

I have the table below.

 

EmployeeManagerManager+1Manager+2Manager+3Manager+4Manager+5
141097811
241097811
341097811
41097811 
561097811
61097811 
7811    
811     
97811   
1097811  

 

As you can see in this company there are 11 employees - the employe 11 is the CEO and he is the uppermost manager. Then each column shows how the hierarchy level of each manager in the organization.

 

I will have a specific manager (lets call him/her Manager X) accessing this dashboard. I would want Manager X to only see the Employees from his own hierarchy. 

For example:

If manager 11 accesses, I would like him to see all 10 rows, as he is the uppermost manager.

If manager 10 accesses, I would like him to see rows 1,2,3,5 and 6 only.

To do this, I created a new measure:

 

Check = IF(MAX('FullHierarchy'[Manager+0])=[Selected_Supervisor]||MAX('FullHierarchy'[Manager+1])=[Selected_Supervisor]||MAX('FullHierarchy'[Manager+2])=[Selected_Supervisor]||

MAX('FullHierarchy'[Manager+3])=[Selected_Supervisor]||MAX('FullHierarchy'[Manager+4])=[Selected_Supervisor]||MAX('FullHierarchy'[Manager+5])=[Selected_Supervisor]||MAX('FullHierarchy'[Manager+6])=[Selected_Supervisor],"Yes","No")

 

The intent of this measure is to find the value of the Manager accessing (selected supervisor) on ALL the manager´s columns, and if found in at least one, have a "Yes", so that I can later filter these "Yes" rows IN. 

 

Unfortunately this measure doesnt work. 

Any ideas? Thanks!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @josemendoza ,

 

Here are the steps you can follow:

1. Copy the Table in Power Query to form Table2.

vyangliumsft_0-1670475868032.png

2. Check the columns with yellow labels – Tranform – Unpivot Columns.

vyangliumsft_1-1670475868036.png

Result:

vyangliumsft_2-1670475868037.png

3. Create measure.

Flag =
var _select=SELECTEDVALUE('Table2'[Value])
var _Flag=SELECTCOLUMNS(FILTER(ALL(Table2),'Table2'[Value]=_select),"1",[Employee])
return
IF(
    MAX('Table'[Employee]) in _Flag,1,0)

4. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_3-1670475868037.png

5. Result:

vyangliumsft_4-1670475868038.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@josemendoza , refer if one of the two can help

https://radacad.com/parsing-organizational-hierarchy-or-chart-of-accounts-in-power-bi-with-parent-ch...

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi  @josemendoza ,

 

Here are the steps you can follow:

1. Copy the Table in Power Query to form Table2.

vyangliumsft_0-1670475868032.png

2. Check the columns with yellow labels – Tranform – Unpivot Columns.

vyangliumsft_1-1670475868036.png

Result:

vyangliumsft_2-1670475868037.png

3. Create measure.

Flag =
var _select=SELECTEDVALUE('Table2'[Value])
var _Flag=SELECTCOLUMNS(FILTER(ALL(Table2),'Table2'[Value]=_select),"1",[Employee])
return
IF(
    MAX('Table'[Employee]) in _Flag,1,0)

4. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_3-1670475868037.png

5. Result:

vyangliumsft_4-1670475868038.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (25)