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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
pbiguru123
Helper II
Helper II

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors