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
Tendo23
Frequent Visitor

Union two tables, Sales table with quantity and BOM table

Hello Folks,

please I need your help again! 😊

I have two tables that need to be merged into a new one.

 

Table SalesData contains the sales budget for next year.

Product

Quantity

Date

Country

A

2

01.01.2024

USA

A

1

01.02.2024

Belgium

B

3

01.04.2024

China

B

4

01.01.2024

USA

C

1

01.03.2024

France

 

 

The second table contains bill of materials for every product:

 

Sales Product

Raw Material

Quantity

A

Material 1

1

A

Material 2

2

A

Material 3

1

B

Material 1

2

B

Material 4

1

C

Material 2

1

C

Material 3

2

 

The goal is to bring both tables together.

 

Product

Quantity Sales Product

Raw Material

Quantity Raw Material

Raw material requirements

Date

A

2

Material 1

1

2

01.01.2024

A

2

Material 2

2

4

01.01.2024

A

2

Material 3

1

2

01.01.2024

A

1

Material 1

1

1

01.02.2024

A

1

Material 2

2

2

01.02.2024

A

1

Material 3

1

1

01.02.2024

B

3

Material 1

2

6

01.04.2024

B

3

Material 4

1

3

01.04.2024

C

1

Material 2

1

1

01.03.2024

C

1

Material 3

2

2

01.03.2024

 

Column “Raw materials requirements” is calculated column based on “Quantity Sales Product” and “Quantity Raw Material”.

 

Can anyone help me how to create the new table from the other two?

 

Tanks a lot!

Tendo

1 ACCEPTED SOLUTION
AnalyticPulse
Impactful Individual
Impactful Individual

I suppose you want to join the tables not uniion of them. 

you can do it in power query. go to merge query and then select your columns which has the common values in your case it seems that you have product column as common column, so use that column to join the tables. i hope you know how to join the tables using merge query.

If this helped, Subscribe AnalyticPulse on YouTube for future updates:
https://www.youtube.com/@AnalyticPulse
https://instagram.com/analytic_pulse
https://analyticpulse.blogspot.com/

subscribe to Youtube channel For fun facts:
https://www.youtube.com/@CogniJourney

View solution in original post

3 REPLIES 3
Tendo23
Frequent Visitor

Hi @AnalyticPulse ,

 

Thank you. I have performed the merge in query. I have not seen the wood for the trees... Sometime a small hint hepls... 🙂

I'm glad it helped, to keep me motivated, Please subscribe to the Youtube channel @CogniJourney
Thanks 😊

AnalyticPulse
Impactful Individual
Impactful Individual

I suppose you want to join the tables not uniion of them. 

you can do it in power query. go to merge query and then select your columns which has the common values in your case it seems that you have product column as common column, so use that column to join the tables. i hope you know how to join the tables using merge query.

If this helped, Subscribe AnalyticPulse on YouTube for future updates:
https://www.youtube.com/@AnalyticPulse
https://instagram.com/analytic_pulse
https://analyticpulse.blogspot.com/

subscribe to Youtube channel For fun facts:
https://www.youtube.com/@CogniJourney

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!

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.