Forum Discussion
Reordering Table Columns in DAX/ Outside of Query Manager
- 8 years ago
To get the table as requested, we can use SELECTCOLUMNS Function (DAX) to reorder columns. For example:
Table = UNION(SELECTCOLUMNS(State1, Name1, Field1, Name2 , Field2…), SELECTCOLUMNS(State2, Name1, Field1, Name2, Field2…)…)
To get the table as requested, we can use SELECTCOLUMNS Function (DAX) to reorder columns. For example:
Table = UNION(SELECTCOLUMNS(State1, Name1, Field1, Name2 , Field2…), SELECTCOLUMNS(State2, Name1, Field1, Name2, Field2…)…)
This is a terrible way to do things, especially when I'm calculating tables with lots of columns.
It would be a nice interim fix if you could add an argument to UNION() that lets you match on column name instead of just column order. Considering that you cannot realisticly change column order a lot of the time, you could at least make sure the column names match and go from there.