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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Ciria
Advocate III
Advocate III

How combine two tables from two spreadsheedts by Using integrated PowerPivot

Dears:Smiley Surprised

 

I have a excel file, daily updated (adding records, or adding results or further information for those records), divided in two spreedsheets.

The first spreedsheet takes Product Type A and the second Product Type B. Because of the European regulation we cannot combine in just one single spreedsheet all the records (audits)

Column structure and headers are quite similar, in fact you could use them independently. This means that in Column B both spreedsheet contains the "Item code", Column C the "Description", and the "Results" are in Column G in both cases 🙂

 

My attempt was to try to mix/combine both tables using either Merge or Append, but in this case what Powerbi does is to put the records on columns, this is after the last column from the first spreedsheet, on the top right.

 

But I would like to do is to find the way to put one after the another, removing before in "Edit Queries" the header from the second one, having a single list with multiple records in order to get data from the whole list.

 

I could do this manually of course, but as I said, this file is updated daily, so the aim would be to create, somehow, a way to do this in Powerbi directly having automatic update.

 

I'm looking forward to hearing from you.

 

Thanks!Smiley Happy

1 ACCEPTED SOLUTION
KHorseman
Community Champion
Community Champion

@Ciria it's hard to tell what's going on when there's nothing in your screenshot but null values. Do all the columns in table 1 have the same names as all of the columns in table 2?  If the columns don't have matching names, Power Query has no way of knowing which column from table 2 is supposed to match up with which column of table 1, so they will be merged as a new set of columns with null values where the two tables overlap.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

8 REPLIES 8
Ciria
Advocate III
Advocate III

Picture 2.JPG

 

Here a picture that shows what I said. As you can see, because of the European regulation, we have to provide different codification to the internal batch, based on the product group/family.

If product belongs to Family A, it goes to the first spreedsheet, on the contrary, if it belong to Family B, it goes to the second spreedsheet.

 

Thanks for your support 🙂

Vvelarde
Community Champion
Community Champion

Edit Query--Append:

 

They put your 2do file's rows below the last row of spreadsheet1

 

Example:

 

File 1

 

ID    Code

1        A

2        B

3        C

 

File 2

 

ID  Code

4     D

5     E

6     F

 

Step 1: Edit QueryStep 1: Edit QueryStep2: AppendStep2: AppendStep 3: ReadyStep 3: Ready

 

 

 




Lima - Peru

These 6 columns in the only columns in the 2 spreadsheets??

/sdjensen

I just created to similar Excel sheets to what you posted. 

 

I first added Excelsheet 1 and the added the 2nd and then used append to load data from sheet 1 into the same table as sheet 2 after this you can just hide table 1 in your model.

 

ExcelTable1.png

 

ExcelTable2.png

/sdjensen

Dears:

 

Thanks a lot for your answers 🙂

 

I have to say that I have the same mindset than you about how append works. I thought when you append two tables, Powerbi just put one table after another.

 

What in my case is doing (I also try in Excel by using PowerPivot), is putting all the rows from Spreedsheet 1, and then all those from Spreendsheet 2, but not right after, but in the end of spreedsheet 1 and starting in the next column.

 

I hope this picture helps, sorry today I can't find the right words in English to explain 😞

 

Captura.JPG

 

Thanks!

Dears:

 

Any support please?

 

I dont' know why Powerbi is doing this.... Smiley Frustrated

 

Thanks in advance,

KHorseman
Community Champion
Community Champion

@Ciria it's hard to tell what's going on when there's nothing in your screenshot but null values. Do all the columns in table 1 have the same names as all of the columns in table 2?  If the columns don't have matching names, Power Query has no way of knowing which column from table 2 is supposed to match up with which column of table 1, so they will be merged as a new set of columns with null values where the two tables overlap.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




KHorseman thanks!!

 

It was what you said, changing the column headers (using the same names in both files), and defining the exact number of columns in both files, Append function worked well 🙂

 

Great job!

 

Thanks again guys!Smiley Very Happy

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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