From the course: Power BI Weekly

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Sorting column order in Power Query

Sorting column order in Power Query - Power BI Tutorial

From the course: Power BI Weekly

Sorting column order in Power Query

- [Narrator] A common problem in Power Query is that sometimes we have a lot of columns within our data table. Let's say that we want to sort them in alphabetical order to reference or use them in further query transformations. We can manually sort them by moving the columns directly within the table, which also adds a step to the applied steps list. For a smaller table, this approach works well enough, but for a large table with a lot of columns, like what we see here, moving them around manually can easily become quite tedious. If we look at the last step for rearranging these columns, notice the M code automatically creates a list object behind the scenes to store the order of these columns, regardless of whether we move them directly or not. We can tell it's a list storing this column order because we see the column names displayed between a set of curly braces and separated by a comma for each column name. Power…

Contents