Skip to main content

Power BI

New

Reordering columns in Power Query editor

Vote (34) Share
Gaurav Saneja's profile image

Gaurav Saneja on 21 Jun 2016 10:46:50

I have been extensively using Power Query at work to automate pulling data from 20 different excel files, access data base and other sources. What I really like about Power Query is I can reorder the columns in each of my data pulls in power query editor and then append more than 20 data tables into 1 query and analyze all that data together.

It would be very helpful if moving/reordering column in each query were little easier. Currently I select a column(s) and move/drag them to the position I want them to be. I have about 100 columns that need to be reordered and moving each one at a time takes a lot of time.

It would be great if you could add a feature like to re-order columns like the one in which (or to it) I can select multiple columns in a vertical view.

Thank you

Comments (7)
Gaurav Saneja's profile image Profile Picture

302d1125 057a-4070-b01f-4a8cb024967f on 16 Aug 2020 04:15:42

RE: Reordering columns in Power Query editor

It would also be nice it reordering actually worked and applied to the tables once you have done them. There is apparently a glitch that doesn't actually reorder them after you apply the steps.

Gaurav Saneja's profile image Profile Picture

848fe56b 6ba0-481f-a091-f236939904b7 on 16 Aug 2020 04:04:06

RE: Reordering columns in Power Query editor

While this issue seems to be about making column re-ordering easier in the UI, it would also be nice if the Table.ReorderColumns command had a way to move a column to the first or last without naming all of the other columns. In my scenario I have a pivot table with a variable number of columns and then I am adding a column to it. I want the new column to be somewhere on the left hand side of the table before all of the pivot columns. The ReorderColumns command won't consistently move the column to the new column where I want it unless I name all of the pivot columns (that have variable names). Commands like MoveFirst, MoveLast, MoveBefore, MoveAfter, would be helpful.

Gaurav Saneja's profile image Profile Picture

b95bcd65 ef1a-4438-991d-7c3e20648c37 on 16 Aug 2020 03:56:33

RE: Reordering columns in Power Query editor

Get the excel team to implement it because currently the desktop app is hideous and barely usable. Just get some UX people to actually spend time on it. I have to google everything like how to reorder columns, how to do such simple things that are straight forward in any database or spreadsheet. Building a web based UI from scratch would be quicker.

Gaurav Saneja's profile image Profile Picture

7faa3384 ffd2-4f0d-9aa8-5dce70d12432 on 16 Aug 2020 03:55:23

RE: Reordering columns in Power Query editor

An option to send a column to the left or right extreme (begining or end) would be good. Then worked upon columns would all be grouped together

Gaurav Saneja's profile image Profile Picture

3f0113d6 f5f4-4426-b95f-940aad46902f on 16 Aug 2020 03:55:14

RE: Reordering columns in Power Query editor

Table.ReorderColumns([Previous Step],{"Col1", "Col2", "Col3", ... "ColX"})

Gaurav Saneja's profile image Profile Picture

e37bb63d ac84-43c6-8750-a2aaeb41a30b on 16 Aug 2020 03:55:00

RE: Reordering columns in Power Query editor

How is this not solved yet? It's been an open issue for more than a year! Do we have an expected release date for the fix?

Gaurav Saneja's profile image Profile Picture

9c35a864 1936-48e9-b05b-7812c1a852d2 on 16 Aug 2020 03:53:42

RE: Reordering columns in Power Query editor

'I agree that there should be a dialog that would allow moving/ordering the columns. Maybe the "Choose Columns" could have two panes - drag from left (all columns) to right (display columns), and the right side would have ability to order with up/down and click/drag.

However, I've found a bit of a workaround for now: move just one column, and then manually edit the resulting expression which does list all the columns

= Table.ReorderColumns(...