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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
pbiguru123
Helper I
Helper I

Merging Issue, return value based on 2 columns instead of matching 1 column

Hello everyone i have 2 tables

IDOrder ID

1aaaa-bbbb
2aabb-bbaa
1123-gvb
2abdf-475
2gsgsd-4674


and table 2

Order IDAmountID

aaaa-bbbb4861
aaaa-bbbb6841
aaaa-bbbb345311
aabb-bbaa448412
aabb-bbaa532
aabb-bbaa772
aabb-bbaa4642
aabb-bbaa1762



when i merge between the wto tables taking id as the key, ordr ID doesnt math and i get multiple rows

pbiguru123_0-1714666891973.png




when i expand, i get this


 

pbiguru123_1-1714666946956.png



i need to add a condition to return order id equal to the main order id which is only aaaa-bbbb for the first 2 examples and not add new rows as yo usee, so match orderid and id 

1 ACCEPTED SOLUTION
dufoq3
Super User
Super User

Hi @pbiguru123

 

hold CTRL during merge step and select continuously columns ID and then Order ID. It will consider matching on both columns, but to be honest I don't understand why do you want to get Order ID from another table when you have Order ID in this table already.

 

dufoq3_0-1714668913530.png

 

Result

dufoq3_1-1714668943546.png

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

2 REPLIES 2
dufoq3
Super User
Super User

Hi @pbiguru123

 

hold CTRL during merge step and select continuously columns ID and then Order ID. It will consider matching on both columns, but to be honest I don't understand why do you want to get Order ID from another table when you have Order ID in this table already.

 

dufoq3_0-1714668913530.png

 

Result

dufoq3_1-1714668943546.png

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

i did not know i could do that cheers

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors