Forum Discussion
Field from one table not directly related to another table
- Anonymous2 years ago
Hi check1 ,
Try merging the query twice like this and then combining the text:
let Source = Table.NestedJoin(TimeEntry, {"Ticket ID"}, Tickets, {"Ticket ID"}, "Tickets", JoinKind.LeftOuter), #"Expanded Tickets" = Table.ExpandTableColumn(Source, "Tickets", {"Employee ID"}, {"Employee ID"}), #"Merged Queries" = Table.NestedJoin(#"Expanded Tickets", {"Employee ID"}, Employee, {"Employee ID"}, "Employee", JoinKind.LeftOuter), #"Expanded Employee" = Table.ExpandTableColumn(#"Merged Queries", "Employee", {"Employee Name"}, {"Employee Name"}), #"Grouped Rows" = Table.Group(#"Expanded Employee", {"UserID"}, {{"Employee Names", each Text.Combine( List.Distinct([Employee Name]),",")}}) in #"Grouped Rows"
Note that the storage mode of the table for the merge query is Import.Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Thanks PwerQueryKees. Hope this give a little better explanation of what I'm trying to do. A ticket is assigned to a primary employee. However, the ticket can have many time entries from many different employees. I am trying to find the name of those employees for those time entries. I can show the UserIDs for each time entry, but I'm trying to resolve the name of the employee associated with that UserID, which is the EmployeeName from the Employee table. If I link the TimeEntry and Employee table (using UserID and EmployeeID) it creates ambiguous paths.
Ok. So the user id is not an employee id. What else have you got to connect a user to an employee? Is there a user table you can use? Is there another filed, like email address you can use?
You mention ambiguous results. What do you mean? Because I would assume it would produce erroneous results or no results at al if you match the user id with employee IDs.
If all of the above does not work, your question might me unsolvable...