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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
xiumi_hou
Post Partisan
Post Partisan

Need Help! How to manage employee and manager relationship

Dear All,

 

I have a a user table which contains all the users ID , users name, user email.... (employee and manager are all on one colunmn)  One column Example:

Employee 1

Employee2 

Employee 3

Employee4 

Manager 1

Employee5 

Employee 6

Employee7

Manager 2 

Employee 8

Employee 9

Employee 10

Employee 11

Employee 12 

Employee 13

Employee 14 

Employee 15

Employee 16

Employee 17

Manager 3

 

If  one employee assigned to one manager, we total have three managers.  I want to show the employee data result by manager. how should I create the employee-manager relationship since this relationship do not exist in the table? Please provide more details. Thanks.!

9 REPLIES 9
ChrisMendoza
Resident Rockstar
Resident Rockstar

I used https://www.daxpatterns.com/parent-child-hierarchies/#organizational-structure. Maybe it will hep you.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Hi Chris, 

 

Thanks for the reply. My question is how the manager name and employee name are both on one colum. How should I assigned the employee to manager? Thanks. @ChrisMendoza 

@xiumi_hou - 

 

The article I provided demonstrates building the relationship between employee and manager. Since that is not built in to your source, you have to build it.







Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



edhans
Super User
Super User

You didn't say how these were related, so in my example I assumed the manager listed was the manager of the employees above him. I now have this table.

image.png

 

See this PBIX file to see how this was done in Power Query. The key is using the Fill Up command on the Transform tab.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

@edhans  

Hi Edhans,

 

Thanks for the reply. No.. It is not in any order I need to mannully figure out which employee belong to which manager. Do you have any idea about this? Thanks. 

How would anyone know what manager beloned to which employee? You need a key that ties a manager to an employee. DAX is cool. It isn't magic. Smiley Happy



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Hi all, @edhans @ChrisMendoza 

 

I have a list of which employee belongs to which manager like this: 

Manager 1       Manger 2       Manager 3

Employ11          Employ21         Employ31

Employ12          Employ22         Employ32

Employ13          Employ23         Employ33

Employ14          Employ24         Employ34

Employ15          Employ25         Employ35

 

But the data in our database are all stored in one column with no order. How should I bulid the relationship between manager and employee? Thanks

 

 

You need to unpivot your table. See my file link again. It will turn your table into a matrix that will allow you to link it to the database columns and assign managers to employees.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

@xiumi_hou -

 

The article accurately describes how you can accomplish your task. I have personally used this in a similar circumstance. I suggest you review the documents and apply the techniques.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.