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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Join multiple tables and Move Columns

Hi everyone,

I hope someone can help me, 
Sorry if this is not the forum, but I don't know if the problem is in Desktop or Power Query ... I explain my situation:

 

I have 3 large volume databases. They are identical, but for some reason Power Bi desktop changes the order of the columns in the first table.

 

It's weird because in Power Query, I see the preview structure for all databases as (exemple):
Column A = Customer, Column B = Date, Column C = Product Code and Column D = Quantity.

 

But when I apply the changes and load the data ... this happens in Power BI Desktop:

 

Table 1

CustomerDateQuantityProduct Code

 

Table 2

CustomerDateProduct CodeQuantity

 

Table 3

CustomerDateProduct CodeQuantity

 

To solve it I use the "move columns" function in Power Query but nothing changes ...:
 = Table.ReorderColumns (# "Previous step", {"Customer", "Date", "Product Code", "Quantity" "}),

This is a problem, because when I want to create a new table by joining the 3 tables through the DAX function "JOIN", the data is not added correctly (because mix quantity data and product code data)

 

Thank you very much in advance!!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Append or merge both append or join tables based on the column names, whey order is important.

 

This seems like an append case and it should work with name

View solution in original post

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

As far as I know, the Power BI Desktop displays the column order according to the change when the column last time sort, and power Query sometimes does not correspond, but does not affect the merge table, as long as your column name relative to, can be merged, such as:

vyalanwumsft_0-1635131785287.png

when union it by dax .

 

New table = UNION('Table1','Table2')

 

The final output is shown below:

vyalanwumsft_1-1635131834317.png

If you can't , can you share how to  join about your method and share more screenshoots about y?
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

As far as I know, the Power BI Desktop displays the column order according to the change when the column last time sort, and power Query sometimes does not correspond, but does not affect the merge table, as long as your column name relative to, can be merged, such as:

vyalanwumsft_0-1635131785287.png

when union it by dax .

 

New table = UNION('Table1','Table2')

 

The final output is shown below:

vyalanwumsft_1-1635131834317.png

If you can't , can you share how to  join about your method and share more screenshoots about y?
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Append or merge both append or join tables based on the column names, whey order is important.

 

This seems like an append case and it should work with name

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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