cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lokosrio
Helper I
Helper I

Assign employees to manager

Hi,

 

I have a table:

IDE-mail addressIsManagerManagerId
100employee1@company.com0200
101employee2@company.com0200
102employee3@company.com0200
103employee4@company.com0201
104employee5@company.com0201
200manager1@company.com1 
201manager2@company.com1 

based on this I want to create a new table, which will assign employees to managers:

E-mail addressIsManagerid
manager1@company.com1100
manager1@company.com1101
manager1@company.com1102
manager2@company.com1103
manager2@company.com1104
employee1@company.com0100
employee2@company.com0101
employee3@company.com0102
employee4@company.com0103
employee5@company.com0104

 

I tried with CROSSJOIN function:

UNION(
SUMMARIZE(table,table[E-mail],table[IsManager],table[id]),
CROSSJOIN(
        SUMMARIZE(FILTER(table,table[IsManager]="1"),table[E-mail],table[IsTeamLeader])
,SUMMARIZE(table,table[id]))
)

but without success - it is assigning all the data, not only related to the manager. Could you please help me with this?

1 ACCEPTED SOLUTION
mahoneypat
Super User
Super User

Please see this article on how to leverage the PATH function for this.

On the Right PATH() - A DAX/Power Query approach to working with parent/child hierarchies. - P3 Adap...

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Super User
Super User

Please see this article on how to leverage the PATH function for this.

On the Right PATH() - A DAX/Power Query approach to working with parent/child hierarchies. - P3 Adap...

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

hi @mahoneypat,

works great - this is what I wanted to achieve, thank you very much!

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!