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
Anonymous
Not applicable

how to union multiple tables same column name but not same order

hello

 

My first table has the following fields in that order

employeeid, fullname, managerid, managername, herachypath, hierachydepth, level1, level2, level3, ..., allLevelSort, isleaf

 

while the second table has the same field but they are alphabetically sort.

 

When I want to create a new table  allManagers=union('dim manager Level 1' ,'dim manager level2 ') it gives stange things.

Does someone know how to solve this isssue.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous,

For Dax formulas, current you can only use 'SELECTCOLUMNS', 'SUMMARIZE', 'GROUPBY' functions to choose columns and define the order of the columns in variable tables and merge them with union functions.

Table = UNION(GROUPBY(T1,[1],[2],[3],[4],[5]),GROUPBY(T2,[1],[2],[3],[4],[5]))

In addition, you can also do merge table operation in query edit, it allows you to change the order of columns.

let
    Source = Table.Combine({@T1,Table.ReorderColumns(@T2,Table.ColumnNames(@T1))})
in
    Source

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

What is the exact issue you are facing

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Capture20200122A.PNGCapture20200122B.PNG

 

 

if in the second table the order is not exactly the same as in dim manager level1, for ex: 

HierarchyDepth", 'dim Manager Level 1'[HierarchyDepth],  when I create a global table using a union, it add the wrong fields.
 
Is there a way to avoid that
 
Anonymous
Not applicable

Hi @Anonymous,

For Dax formulas, current you can only use 'SELECTCOLUMNS', 'SUMMARIZE', 'GROUPBY' functions to choose columns and define the order of the columns in variable tables and merge them with union functions.

Table = UNION(GROUPBY(T1,[1],[2],[3],[4],[5]),GROUPBY(T2,[1],[2],[3],[4],[5]))

In addition, you can also do merge table operation in query edit, it allows you to change the order of columns.

let
    Source = Table.Combine({@T1,Table.ReorderColumns(@T2,Table.ColumnNames(@T1))})
in
    Source

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.