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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Narendra90
Frequent Visitor

Transform data 1 table to Employee - Manage hierarchy

Hi Team,

I have data ( input data provided here). Every employee has specific targets and so their manager's too.

I want fillter manager and get their suboardinate's results.

for same, i need to transoform data in "output required" format.

would you please help me on this.

Narendra90_1-1691492103475.png

 

 

 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Narendra90 

Thanks for your sample data and end ressult first!

Here are the steps you can refer to , we can realize it in Power Query Editor.

(1)This is my test data :

vyueyunzhmsft_0-1691633664752.png

(2)We can click "Custom Column" in "Add Column" to create columns:

vyueyunzhmsft_1-1691633717198.png

You need to imput the M code and the column name in the box :
SR Manager

try Table.SelectRows(#"Changed Type",(y)=> y[Emp]=[Manager] )[Manager]{0} otherwise null

 

(3)We can follow the upper step to create the second column :
Group Head

try Table.SelectRows(#"Changed Type",(y)=> y[Emp]=[SR Manager] )[Manager]{0} otherwise null

 

(4)Then we can filter the [Group Head] <> null then we can meet your need:

vyueyunzhmsft_2-1691633814568.png

The end result is as follows:

vyueyunzhmsft_3-1691633831291.png

 

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @Narendra90 

Thanks for your sample data and end ressult first!

Here are the steps you can refer to , we can realize it in Power Query Editor.

(1)This is my test data :

vyueyunzhmsft_0-1691633664752.png

(2)We can click "Custom Column" in "Add Column" to create columns:

vyueyunzhmsft_1-1691633717198.png

You need to imput the M code and the column name in the box :
SR Manager

try Table.SelectRows(#"Changed Type",(y)=> y[Emp]=[Manager] )[Manager]{0} otherwise null

 

(3)We can follow the upper step to create the second column :
Group Head

try Table.SelectRows(#"Changed Type",(y)=> y[Emp]=[SR Manager] )[Manager]{0} otherwise null

 

(4)Then we can filter the [Group Head] <> null then we can meet your need:

vyueyunzhmsft_2-1691633814568.png

The end result is as follows:

vyueyunzhmsft_3-1691633831291.png

 

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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 Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI 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.

Top Solution Authors
Top Kudoed Authors