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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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? 

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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 

 

 

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.