Forum Discussion
Union column order
I am sorry for the long delay. I had needed to re-work my data, and the tables were unioning properly. However, when I had need to change it again, I am getting the same issue again.
Here is a pbix file in which I replicated the problem (TableF)
https://drive.google.com/open?id=0B_6Tqj6N3i6HZnR6TG5qQ2lmLWM
From the documentation, regarding UNION, it says: Columns are combined by position in their respective tables.
So you could use SUMMARIZE with TableB like:
Table F =
UNION (
SUMMARIZE ( TableA, TableA[a6], TableA[a8x], "hits", COUNT ( TableA[a5] ) ),
SUMMARIZE ( TableB, TableB[b2], TableB[b1], TableB[b3x] )
)
At least the columns order is predictable.
Tom
- Anonymous9 years agoNot applicable
I tried this, but similar to using SELECTCOLUMNS, the calculated column still wants to become the first column.
- P3Tom9 years agoHelper I
Interesting!
I tried my solution before posting and had no difficulty creating a desired column order.
Tom
- Anonymous9 years agoNot applicable
I wish we could UNION on something less arbirary than column order. I believe APPEND in query editor uses column names.\
*edit* Unfortunately, I can't use append or model my data in the query editor. I had to use UNION to join my source data which is separated by month. I don't need the past months' data to refresh. If I were to APPEND those tables, even if they were flagged not to refresh they would refresh.