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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pburness
Regular Visitor

Add contents of two tables to create a third table

I have two tables (Table A and Table B), Both tables have exactly the same columns and all columns except one column are decimal numbers. The tables are related via the one non-decimal column called names.

 

I want to add (sum) each column from Table A and Table B together to create a third Table C, with the one non-decimal number column, i.e.

 

Table C[Column 1] = (Table A[Column1] + Table B[Column1]) where Table A [Names] = Table B[Names].

 

Is this possible? if so, how do I do it?

 

Thanks

Phil

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @pburness

 

First, create a Merge Query as below.

2.png

Then try to add an Append Query as below:

1.png

 

Then Merge the two queries as below and remove Table columns as requested.

1.png

 

Last, Group the new query as below. You may need to do it with M language in Advanced Editor.

 

1.png

Regards,

Cherie

 

 

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-cherch-msft
Employee
Employee

Hi @pburness

 

First, create a Merge Query as below.

2.png

Then try to add an Append Query as below:

1.png

 

Then Merge the two queries as below and remove Table columns as requested.

1.png

 

Last, Group the new query as below. You may need to do it with M language in Advanced Editor.

 

1.png

Regards,

Cherie

 

 

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-cherch-msft
Employee
Employee

Hi @pburness

 

You may try to use Merge Queries in Query Editor as below.  

1.png

 

Then expend the table without name column and filter all values without the null values.

2.png3.png

 

Create custom columns to sum the values from 2 table as requested.

4.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Cherie,

This works, but I was hoping there was a way to automate the task. There are 80 columns in each table, so not a huge burden, but still a bit of a chore...

 

Phil

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.