Forum Discussion
Union column order
I don't think I can reorder using DAX, because the SUMMARIZE function always puts the summarized columns first.
Hi Anonymous,
So could you share a sample pbix file(with just some sample/mock data) 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. :smileyhappy:
Regards
- Anonymous9 years agoNot applicable
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
- P3Tom9 years agoHelper I
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.