Forum Discussion
majdkaid22
9 years agoHelper V
Reorder columns in Query Editor without listing the column names
Hi guys, am doing union dax for 10 tables. While the process is easy, my columns in each table are not in the same order. In power Query, all the columns in 10 tables are in the exact same o...
- 9 years ago
hi majdkaid22,
You may reorder your columns in power query alphabetically using a custom code.
=Table.ReorderColumns( NameOfPreviousStep, List.Order( Table.ColumnNames( NameOfPreviousStep ), Order.Ascending )
danextian
9 years agoSuper User
hi majdkaid22,
You may reorder your columns in power query alphabetically using a custom code.
=Table.ReorderColumns( NameOfPreviousStep, List.Order( Table.ColumnNames( NameOfPreviousStep ), Order.Ascending )
- majdkaid229 years agoHelper V
danextian v-jiascu-msft thanks gents. this solution worked!
- Anonymous8 years agoNot applicable
In the Power Query editor for excel, the name of the function is List.Sort. I assume it's the exact equivalent because it worked fine, I didn't even check the arguments.
- Anonymous7 years agoNot applicable
This got me pointed in the right direction, maybe things have changed with time, but I had to make some adjustments to above for it to work:
Table.ReorderColumns(PreviousStep, List.Sort(Table.ColumnNames(PreviousStep),Order.Ascending))
- Ssibbett6 years agoFrequent Visitor
I like this subject. Is there a way to do this but omiting the first 4 columns?
First 4 columns would remain as: "Item Name","Package Type","Attribute","Item No"