Forum Discussion

soedholm's avatar
soedholm
Regular Visitor
9 years ago
Solved

match string values in two diffrent tables

Hi,

 

I have two tables what each have a column for email. I'd like to "match" the emails to get country value from the second table into the first. Situation is:

 

Table A:

email1

 

Table B:

email2

country

 

I'd like to say "If Email2 in Table B matches Email1 in Table A, add value in Table A for country". Is this possible?

 

  • soedholm

     

    You can also use DAX to achieve your goal. Just add the calculated column in table A and use LOOKUPVALUE() to get the country column.

     

    Country Column = LOOKUPVALUE(TableB[Country],TableA[Email1],TableB[Email2])

     

    Regards,

3 Replies

  • Vvelarde's avatar
    Vvelarde
    Community Champion

    hi soedholm

     

    Go to Edit Query -- Merge Query

     

    +

     

    Step 2: Click on expand

     

     

    The result is 

     

  • v-sihou-msft's avatar
    v-sihou-msft
    Microsoft Employee

    soedholm

     

    You can also use DAX to achieve your goal. Just add the calculated column in table A and use LOOKUPVALUE() to get the country column.

     

    Country Column = LOOKUPVALUE(TableB[Country],TableA[Email1],TableB[Email2])

     

    Regards,