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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
andywil456
Advocate II
Advocate II

union formula column section error

I have 3 sharepoint files all with a number of excel tables. All the tables are in the same format and layout, for each field sale to complete. the 3 sharepoint files cover different periods but the format and layout is consistant throughout. 

I have used the Union formula to create 1 master database to build my dashboard from, however the union formula has mixed up the columns. As per my screenshot in the  date column i have a few dates but also a few postcodes etc.

Is there anyway of redirecting each column so that the correct data is being selected?

Untitled.png

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@andywil456

 

In DAX, when using UNION(), columns are combined by position in their respective tables. And column names in the return table will  just match the column names in table_expression1. So make sure columns in two tables has same order. In your scenario, I suggest you go to Query Editor, "move" columns under Transform tab. 

 

66.PNG

Then you can use "Append Query" to combine two datasets together.

67.PNG

Regards,

 

View solution in original post

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

@andywil456

 

In DAX, when using UNION(), columns are combined by position in their respective tables. And column names in the return table will  just match the column names in table_expression1. So make sure columns in two tables has same order. In your scenario, I suggest you go to Query Editor, "move" columns under Transform tab. 

 

66.PNG

Then you can use "Append Query" to combine two datasets together.

67.PNG

Regards,

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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