Forum Discussion
Lookup table doubles as fact table
- Anonymous4 years ago
Hi Anonymous ,
According to your description—— In order to find the name of the manager I have to take the manager's user ID and look it up against same Users table.
It seems that userID , managerName are in the same table, so the data table may be like:
If you want a managerID column:
Column = LOOKUPVALUE('Table'[userID],'Table'[userName],[managerName])Or you want a manager table:
Manager Table = ADDCOLUMNS( VALUES('Table'[managerName]),"managerID",LOOKUPVALUE('Table'[userID],'Table'[userName],[managerName]))Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to Get Your Question Answered Quickly - Microsoft Power BI Community
How to provide sample data in the Power BI Forum - Microsoft Power BI Community
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
According to your description—— In order to find the name of the manager I have to take the manager's user ID and look it up against same Users table.
It seems that userID , managerName are in the same table, so the data table may be like:
If you want a managerID column:
Column = LOOKUPVALUE('Table'[userID],'Table'[userName],[managerName])
Or you want a manager table:
Manager Table = ADDCOLUMNS( VALUES('Table'[managerName]),"managerID",LOOKUPVALUE('Table'[userID],'Table'[userName],[managerName]))
Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to Get Your Question Answered Quickly - Microsoft Power BI Community
How to provide sample data in the Power BI Forum - Microsoft Power BI Community
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
Hi Evelyn,
My Users table looks like this, but has many more columns, including email, department, hire date, etc.
So in the case above, if I want to get Belinda's managers name, I need to take the manager ID and look it up in the ID column. I know that I can duplicate the Users table and create a relationship between Manager ID in the table above and user ID in the new copy, or create additional columns in the table per your suggestion. Both of those techniques require duplicating information that already exists though, so I am wondering if there is a way to create a relationship between 2 fields in the same table? If not, what is the best practice here?
Thanks,
Ben