cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jack421 Helper III
Helper III

create column from different tables

I have 2 tables, and I want to add the Region column to Table 2 based on the Customer Name match. If there is a customer name match, I'd like the region to match what is in Table 1. If there is not a match (i.e. Customer 'C'), I want the value to be Unknown. Can someone assist me with this?

 

Table 1

Customer NameRegion
AUSA
BEurope

 

Table 2

Customer NameRegion (desired column)
AUSA
BEurope
CUnknown
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: create column from different tables

hi  @jack421 

You could use LOOKUPVALUE Function to create a calculate column as below:

https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax

Region = var _region= LOOKUPVALUE('Table 1'[Region],'Table 1'[Customer Name],'Table 2'[Customer Name]) return
IF(ISBLANK(_region),"Unknown",_region)

Result:

2.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
camargos88 Community Champion
Community Champion

Re: create column from different tables

Hi @jack421 ,

 

See the file attached. You just need to handle it on Power Query (clean values, merge with left or right (depends on where you start it, and finally replace null to Unknown like you wish).

 

Download PBIX 

 

 

Ricardo


Did I answer your question? Mark my post as a solution!
Ricardo

Community Support
Community Support

Re: create column from different tables

hi  @jack421 

You could use LOOKUPVALUE Function to create a calculate column as below:

https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax

Region = var _region= LOOKUPVALUE('Table 1'[Region],'Table 1'[Customer Name],'Table 2'[Customer Name]) return
IF(ISBLANK(_region),"Unknown",_region)

Result:

2.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors