cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Arial12 Frequent Visitor
Frequent Visitor

Inner join more than one column

Hello there experts,

 

Two tables don't have a direct relationship.

 

Table 1 has more rows than table2:

 

Itemnumber, Code, description, priority

2                      001        Aztek         1

3                      003        valve          2

4                      010         Base          3

5                      010         Base          1

6                      004         BPL            2

10                    001         IVV             1

 

Table2:

 

Code, description, Priority, specialneed

001         Aztek         1                AB

003          Vakve        2                J

010           Base          1             AL

001            IVV            1              ZX

 

 

I want to add a column in table 1: Specialneed with a value from Table2.Specialneed where code, description and Priority matches from both table if there is no match then leave the value in Table1 blank for Specialneed column.

 

 

After the match Table1 expected:

 

Itemnumber, Code, description, priority  Specialneed

2                      001        Aztek         1               AB

3                      003        valve          2               J

4                      010         Base          3               

5                      010         Base          1                AL

6                      004         BPL            2

10                    001         IVV             1               ZX

 

 

I don't want to do another calculated table, just want to add a column in tabl1.

 

Any help is appreciated.

 

Thanks,

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Inner join more than one column

Hey,

 

you can create a calculated column in Table1 by using the function LOOKUPVALUE like so:

SpecialNeed =
LOOKUPVALUE(
'Table2'[specialneed]
,'Table2'[Code],'Table1'[Code]
,'Table2'[description],'Table1'[description]
)

Hopefully this is what you are looking for.

 

Regards,

Tom

 

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
1 REPLY 1
Super User
Super User

Re: Inner join more than one column

Hey,

 

you can create a calculated column in Table1 by using the function LOOKUPVALUE like so:

SpecialNeed =
LOOKUPVALUE(
'Table2'[specialneed]
,'Table2'[Code],'Table1'[Code]
,'Table2'[description],'Table1'[description]
)

Hopefully this is what you are looking for.

 

Regards,

Tom

 

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 151 members 1,818 guests
Please welcome our newest community members: