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
Yug
Frequent Visitor

Connecting two columns in Table 1 with a one column in Table 2

I have two tables where:

Table 1 has two columns with location id information. "Delivery loation id", and "redelivery location id"

Table 2 contains the mapping of all location ids to the location names.

 

I need to connect "delivery location id" and "redelivery location id" to the same Table 2 in order to map the location names for each columns in TAble 1.

 

PowerBI is only allowing to have one active relation with Table 2.

Please suggest how I can map both columns from Table 1 to Table 2. 

 Table 1  
    
ProductDelivery Location idOwnerRedelivery location id
BA13Tom44
AA87Pia10
BC93Ram92
BB96Mark39
CC49Alan20
DD24Max31
EE32Lex81

 

Table 2 
  
Location IDLocation name
10Bremen
13Munich
44Frankfurt
87Berlin
92Sttutguart
93Aachen
96Rostock

 

Thanks!

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Yug ,

 

You could create two columns like below in table 1:-

delivery_location = LOOKUPVALUE(_table2[Location name],_table2[Location ID],_table1[Delivery Location id])
redelivery_location = LOOKUPVALUE(_table2[Location name],_table2[Location ID],_table1[Redelivery location id])

Output:-

Samarth_18_0-1649772935243.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

2 REPLIES 2
Yug
Frequent Visitor

Hi @Samarth_18 ,

 

Thanks a lot. This is helpful. 

 

Just one further question: Do I need to also lookup all other columns from Table 2 (such as: longitutide, latitude, Zones etc) within Table 1? OR is there any other way to connect to other additional columns in Table 2?

 

Thanks in advance!

Best regards,

Yug

Samarth_18
Community Champion
Community Champion

Hi @Yug ,

 

You could create two columns like below in table 1:-

delivery_location = LOOKUPVALUE(_table2[Location name],_table2[Location ID],_table1[Delivery Location id])
redelivery_location = LOOKUPVALUE(_table2[Location name],_table2[Location ID],_table1[Redelivery location id])

Output:-

Samarth_18_0-1649772935243.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

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.