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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
123117
Frequent Visitor

UNION tables

Hey, 

I wanted to use union to combine four tables, all with different number of columns and different column values, apart from one same column of 'code number' among all columns. How to do that? 

 

Please help me out 

 

Thanks!

7 REPLIES 7
HotChilli
Super User
Super User

Yes, that would be a merge

https://docs.microsoft.com/en-us/power-query/merge-queries-overview 

using Code as the joining field

Hey,

 But can I use something else? Like relationship or multiple UNIONS or DAX or something? 

Anonymous
Not applicable

HI @123117,

You can try to nested use UNION and SELECTCOLUMNS functions to shape and transform your tables to similar structures before using the UNION function.

UNION function (DAX) - DAX | Microsoft Docs

SELECTCOLUMNS function (DAX) - DAX | Microsoft Docs

Regards,

Xiaoxin Sheng

Hi,

I'm trying merge

But when I'm loading one of the tables I'm getting this error

 

DataFormat.Error: We couldn't convert to Number.
Details:
A0085805

 

But when I check the data type options I dont get options apart from; text, whole no, decimal etc theres no option for any 

The data type for the current column is Text and there are mixed values in the column

Please help 

 

 

Anonymous
Not applicable

Hi @123117,

Can you please share some more detailed information about this issue? They will help us clarify your scenario and test to troubleshoot.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

HotChilli
Super User
Super User

I don't think you can use UNION for this.

Maybe a merge in Power Query but perhaps you can explain further your desired result? with an example?

Hey,

Thanks for your reply 

Here's an example of the tables, the columns are separated by | 

All tables have different number of columns 

 

Table 1

Code | Description | X | Y | Z

 

Table 2 

Code | Description | A | B | C | D | E 

 

Table 3

Code | Description | Date | L 

 

Table 4 

Code | Description | R | S | T | U | V | W

 

Result output: 

Code | Description |  X | Y | Z | A | B | C | D | E | Date | L | R | S | T | U | V | W 

 

Basically the result should be all the columns combined and then Ill add some measures too 

And all the columns combined with values corresponding to the code.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.