Forum Discussion
Look up name from a table
Hi everyone:
I have Table1 where several columns which represent entities (clients, partners, etc.) are represented with IDs rather than names. I also have Table2 where all of these entity IDs are listed in the single column and entity type (clients, partners, etc.) is defined in another column. Wondering how I can pull the names for each of the ID columns in my Table1 so I can use those variables in my charts with actual names.
Any help will be much appreciated.
Thank you!
Yev
YevD
You can check the lookupvalue function:
https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax
7 Replies
- Fowmy
Super User
YevD
You can check the lookupvalue function:
https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax - AnonymousNot applicable
YevD
For example,Table:
ID Name 1 A 2 B 3 C 4 D 5 E Table 2:
ID 1 1 3 3 You can just create a column in Table 2 with: Name = Related('Table 1'[Name]). It is assumed there is a relationship between ID columns, You would get this.
ID Name 1 A 1 A 3 C 3 C If that is not your scenario, you can just create a sample using random values without sensitive information.
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.- YevD
Helper I
Unfortunately I couldn't get it to work using Related function. Maybe it's because of the way my relationships are set up. I appreciate the response!
- krishna0
Helper II
Hello,
I suppose this should be possible via building data model (connecting both tables by ID in the model view). Did you try that? Are you able to share your report or part of it to verify?
Best regards,
- YevD
Helper I
Hi krishna0 ,
Unfortunately I cannot share this file. The tables are linked in the model, seemingly correctly. I have one to many relationship from ID field in Table2 to each of the columns representing the Entities in Table1. But for some reason when I use, say, count of a variable from Table1 in column values and then Name from Table2 in column series the whole chart just turns blank. I am also adding the filter to show the type of entity I am interested in, but it stays blank.