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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rogerching90
New Member

Union of many tables matching wrong columns

Hi,

 

I have many tables that i wish to union but some of them gave me the wrong columns order. Some threads here have given solution like using the formula [SELECTEDCOLUMN] but that only works practically very well if you have 2 tables.

 

How it happened

There is an existing table (let's call it UnionTable) with 4 years worth of datapoints from 4 different tables (T1T2 T3 T4). Then i worked on the UnionTable, thereafter adding some columns that i needed for some calculation. I then wanted to add extra tables (T5 T6) so i copied the formula i used for T1 (just with different filter cause i wanted a table with that information). When i added T5 T6 into the Union Formula for UnionTable, the columns just went haywire.

 

Is there any way to solve this thing without having to use the SELECTEDCOLUMNS formula because then i have to manually override the formula for all the 6 tables (or even more if i have more tables)

 

Any help/advice is greatly appreciated.

1 REPLY 1
danextian
Super User
Super User

Hi @rogerching90 ,

 

That is the behavior of UNION. Unlike append in Power Query, UNION does not combine tables based on column nameS but by position in their respective tables. Thus the use of SELECTCOLUMNS to reposition the columns prior to UNION.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors