Forum Discussion
Power BI adding. a new column
I manage two tables: one called 'Manager' with columns for Name, Id, LastName, and structuralUnit, and another called 'Employee' with columns for FirstName, LastName, structuralUnit, and EmployerID. I'm interested in enhancing the 'Inventory' table by adding a new column. This column, named 'ManagerID,' would store the ID of the manager for employees who have recently connected. How do i do this in power BI
2 Replies
- HotChilliCommunity Champion
I make that 3 tables. So it's not clear whether you have 2 or 3 tables and where you are getting the managerID from and what "employees who have recently connected" means.
Can you read this and repost please?
- AnonymousNot applicable
HotChilli , thanks for your concern about this case. I have some additional information.
Hi jpstayfocus ,
Assuming that there is an Inventory table that can get a direct relationship to "ManagerID" from the A table, you consider using the Related() function.
ManagerID = RELATED('A'[Id])
RELATED function (DAX) - DAX | Microsoft Learn
USERELATIONSHIP function (DAX) - DAX | Microsoft Learn
If not, you need to consider the relationship between the three tables, and use an aggregation function such as Sumx() or Maxx() to get the corresponding columns in table B, and then use the columns in table B to get the "ManagerID" in table A.
"ManagerID".
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly