Link to home
Start Free TrialLog in
Avatar of thomas-sherrouse
thomas-sherrouseFlag for United States of America

asked on

Power Query - Query Active Directory for User's Manager

I'm new to Power Query and I'm trying to create a query that returns user information from our Active Directory that displays the User's DisplayName and Manager.

I can drill into the user column and see the Manager, but when I just select the Manager from drop down of the User. It returns a Record Link and when I click on it drills into the User's Manager Detail.

Here are the steps I'm taking to filter to the User.Manager

User generated image
Avatar of regmigrant
regmigrant
Flag of United Kingdom of Great Britain and Northern Ireland image

Don't have access to AD data structure at the moment but as no-one else has offered a solution:-

In database terms you are already retrieving the foreign key to the manager record, you need to join the staff table to itself so that the query can recursively find the display name for the manager.

In sql this would be along the lines of

select emp.displayname, mgr.displayname from Employee Emp, Employee MGR
Where emp.Manager = mgr.ID

Open in new window

Avatar of thomas-sherrouse

ASKER

regmigrant - thanks for your help. I think I've figured it out. I'm not sure how to explain the solution. Thanks again.
ASKER CERTIFIED SOLUTION
Avatar of thomas-sherrouse
thomas-sherrouse
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
glad to hear, please close as you think appropriate
I don't think I could explain my question clearly. I was able to figure out my question.