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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
kferrone
Regular Visitor

Union thinks column numbers are different

I am trying to make a union between two of the same table. I am following a tutorial on how to make tables incrementally load: Incrementally Load tables.

First I import the original tables the default PowerBI way which imports every column into a table. On those tables you can right click and view the source query which I copied and pasted into a new table where I simply add a where clause to the end to narrow in on the new data.

Then I go to modeling in the ribbon and create a new table with a union like so: tbl_union = UNION('tbl_old_data','tbl_new_data').

The issue is sometimes the tables will Union together just fine, then others will complain the number of columns don't match up.
The error message: "Each table argument of 'UNION' must have the same number of columns."

Each table I did this to, I followed the same exact process. It is really weird only some tables get this error and others don't. I have a feeling the problem is due to some kind of type mismatch with a column from each table. I'm pretty sure the default import is importing some columns as a different type than when the data came from a query.

Can anyone help clarify what is wrong here?

3 REPLIES 3
Anonymous
Not applicable

Hi @kferrone,

 

If you can't ensure these columns will be changed, you can try to use SELECTCOLUMNS function to choose specific columns.

Merged Table= 
UNION(
SELECTCOLUMNS('Table1',"COLUMN1",[Column1],"COLUMN2",[Column2],...),
SELECTCOLUMNS('Table2',"COLUMN1",[Column1],"COLUMN2",[Column2],...),
SELECTCOLUMNS('Table3',"COLUMN1",[Column1],"COLUMN2",[Column2],...)
)

 

You can also try use Table.InsertRows(Power query) to merge there tables.

 

In addition, if above not help, can you please share some sample data to test?

 

Regards,

Xiaoxin SHeng

Anonymous
Not applicable

I get this error even when using ADDCOLUMS to choose my colums from each table. Why does UNION think I don't have the same number of columns from each table? 

 

PBIUnionError.PNG

 

 

Thank you. This really helped:)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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