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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

How to merge two tables based on 2 similar columns

Hello,

I have the following two tables and i am trying to merge them into a single table by keeping the first 2 common columns and then appending all the other columns. Is this possible? Any help is much appreciated!

 

First Table

YearWeek numberItemsReturnsDefective
20221348
202226917
202232510
202249316
202255615
202262210
202277822
202283313
202296318
2022103314
2022112717
2022123722

 

Second Table

YearWeek numberSoldExcessExpired
202212811
202226210
202233612
202243512
202257315
202262311
202279319
202284713
202297218
2022108914
2022115217
2022123621

 

Results:

YearWeek numberItemsReturnsDefectiveSoldExcessExpired
202213482811
2022269176210
2022325103612
2022493163512
2022556157315
2022622102311
2022778229319
2022833134713
2022963187218
20221033148914
20221127175217
20221237223621
1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Looks like a merge on a Year and Week Number (inner join) but are you wanting something else to happen to the Expired column?

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

Looks like a merge on a Year and Week Number (inner join) but are you wanting something else to happen to the Expired column?

Anonymous
Not applicable

@HotChilli Thanks for your reply! Sorry, there was an error with the Expired column. I used inner join successfully! Inner join - Power Query | Microsoft Docs

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors