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
DejanLazarevic
New Member

Append data from four tables into one new table

Hi,

I have four tables with the same column name and data type. I have to append data from all four tables into one, new.

I can do append data with Append Queries as New options but only with two tables.

When I try to do the action (Append Queries as New) with three or four tables together I got an error:

 

Apply query changes
Append1
Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [DataSource.Error] MySQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union all select

 

Do you have any idea what is the problem?

 

Thank you

1 ACCEPTED SOLUTION
edhans
Super User
Super User

It sounds like Power Query is trying to fold the queries back to the MySQL source, and MySQL cannot handle a UNION statement with more than 2 tables.

 

To fix this, break folding. To do this, go to each table you want to append and in the last step, wrap it with Table.Buffer(). 

So if the last step is something like:

Table.AddColumn(#"Changed Type", "Total", each [Cost] + [Tax])

Make it

Table.Buffer(Table.AddColumn(#"Changed Type", "Total", each [Cost] + [Tax]))

Then Power Query will do the combinations in the mashup engine vs asking the server to do it.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
DejanLazarevic
New Member

Thank you Edhans. This solves my problem.

edhans
Super User
Super User

It sounds like Power Query is trying to fold the queries back to the MySQL source, and MySQL cannot handle a UNION statement with more than 2 tables.

 

To fix this, break folding. To do this, go to each table you want to append and in the last step, wrap it with Table.Buffer(). 

So if the last step is something like:

Table.AddColumn(#"Changed Type", "Total", each [Cost] + [Tax])

Make it

Table.Buffer(Table.AddColumn(#"Changed Type", "Total", each [Cost] + [Tax]))

Then Power Query will do the combinations in the mashup engine vs asking the server to do it.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.

Top Solution Authors