Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Solved! Go to Solution.
@YevD
You can check the lookupvalue function:
https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@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.
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!
@YevD
You can check the lookupvalue function:
https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
I took a lot of trial and error, but I got the result I needed with thhe lookup function.
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,
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
98 | |
79 | |
74 | |
66 |
User | Count |
---|---|
136 | |
109 | |
104 | |
82 | |
73 |