Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
YevD
Helper I
Helper I

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 

 

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@YevD 

You can check the lookupvalue function:
https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

7 REPLIES 7
V-pazhen-msft
Community Support
Community Support

@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!

 

Fowmy
Super User
Super User

@YevD 

You can check the lookupvalue function:
https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax

Did I answer your question? Mark my post as a solution! and hit thumbs up


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.

Thank you @Fowmy , I will take a look.

krishna0
Helper II
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,

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.