I appreciate this may be a non starter, but is there a way to sort the columns in a data set in PQ, using an external list of the columns you want in order?
My situation is that I am provided with a set of data, that is quite frankly a holy mess. It has approx 150 columns, and the owner of the database is unresponsive to requests to sort the columns into a logical order from which I need to pull a growing number of reports.
It is quite a long and very laborious task to arrange the columns as well as selecting those to keep for a task.
If I create a list of the columns I need in a worksheet, in the order I need them, is there a way to import this into PQ and get it to re-order the columns to suit?
I appreciate that after i have done it once, i can copy the m code to use again, but this would be a handy thing to be able to do from the outset.
Thanks in advance for any responses.
Dave
Just an update - i havent found a way to do this with an external source, however i have found the Choose Columns function, which allows the mass deletion of columns not required... from there sorting is fairly simple.
Thanks
Dave
Hi Dave,
I don't know a way to sort columns from an external list either, but you could create the line of M code outside of Power Query and copy it in, if that's any help.
Although it sounds like the Choose Columns function has helped alleviate some of the pain already 🙂
Mynda