cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VSchepens Regular Visitor
Regular Visitor

How to union or append tables with different column order?

Hi,

 

We have two tables created via DAX that we want to append to one table.

 

Because we created them via DAX we can't use Query Editor and we can't use UNION() because the order of columns is different. Newly created columns are added at the end of the first table and they need to be combined with columns at the beginning of the second table.

 

Any ideas on this?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to union or append tables with different column order?

Hey,

 

not sure if I understand your requirements correctly, if you want to append ROWS (the combined table gets longer) maybe

SELECTCOLUMS will be helpful https://msdn.microsoft.com/en-us/query-bi/dax/selectcolumns-function-dax

 

If you want to make your table wider (more columns) then you might consider

Maybe you also might consider to create sample data, upload a PBIX to onedrive or dropbox and share the link maybe with scribble visaulizing the expected result.

 

Regards,

Tom

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
2 REPLIES 2
Super User
Super User

Re: How to union or append tables with different column order?

Hey,

 

not sure if I understand your requirements correctly, if you want to append ROWS (the combined table gets longer) maybe

SELECTCOLUMS will be helpful https://msdn.microsoft.com/en-us/query-bi/dax/selectcolumns-function-dax

 

If you want to make your table wider (more columns) then you might consider

Maybe you also might consider to create sample data, upload a PBIX to onedrive or dropbox and share the link maybe with scribble visaulizing the expected result.

 

Regards,

Tom

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
vjnvinod Member
Member

Re: How to union or append tables with different column order?

@VSchepens

 

selectcoloumns should do