Forum Discussion
Union column order
I'm trying to use the UNION function with two summarized tables and a third table.
The first two tables are summarized in the exact same way, and their resulting column order is also the same. The third table, however, which has the same columns as the summarized tables, has a different column order and the values are going into the wrong places.
I tried changing the order of the third table in the query editor, and it did nothing. I would have tried using the append function in the query editor, but two of my tables are calculated tables and they don't show up in the query editor. I also tried specifying the column order with the SELECTCOLUMNS function, but somehow they still ended up in the wrong order.
How can I merge these tables properly?
10 Replies
- v-ljerr-msftMicrosoft Employee
Hi Anonymous,
I tried changing the order of the third table in the query editor, and it did nothing.
Based on my test, after changing the order of the table in the query editor, we still need to reload the query/table to data mode to reflect the column order changes to Data mode.
To reload the data mode, you can uncheck the "Enable Load" option, then recheck the option for the query/table in query editor, then Refresh your data mode after "Close&Apply". :smileyhappy:
Regards
- AnonymousNot applicable
Reloding the data as you suggested did change the column position in the data view, however it is still in the wrong order after the UNION
- v-ljerr-msftMicrosoft Employee
Hi Anonymous,
Reloding the data as you suggested did change the column position in the data view, however it is still in the wrong order after the UNION
According to your description above, I have tested it on my environment with the latest version of Power BI Desktop(2.48.4792.721 64-bit (July 2017)). And the UNION works all fine the the right order after reordered the column in Query Editor.
Could you share a sample pbix file which can reproduce this issue? So that we can help further investigate on it. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.
In addition, I just wondering if it is possible for you to reorder the columns for the summarize table by modifying it's DAX formula. :smileyhappy:
Regards