Sort data (Power Query)

You can sort data to arrange in:

  • Ascending order (text is A-Z, number is smallest to largest, and date is oldest to newest).

  • Descending order (text is Z-A, number is highest to lowest, and date is newest to oldest).

  1. To open a query, locate one previously loaded from the Power Query Editor, select a cell in the data, and then select Query > Edit. For more information see Create, load, or edit a query in Excel.

  2. Select the down arrow ( Filter arrow ) next to the column you want to sort.

  3. In the drop-down menu, select Sort Ascending or Sort Descending.

Select sort order

When you sort based upon multiple columns, the order or hierarchy of the sorting is based on the order that the columns were selected.

  1. To open a query, locate one previously loaded from the Power Query Editor, select a cell in the data, and then select Query > Edit. For more information see Create, load, or edit a query in Excel.

  2. Select the down arrow ( Filter arrow ) next to the column you want to sort.

  3. In the drop-down menu, select Sort Ascending or Sort Descending.

  4. Repeat steps 2 and 3 for each subsequent column you want to use for sorting.

For example, when you sort by State then Population, the final result is a table ordered by state with the cities in each state ordered by population. Alphabetically, Arizona comes before California. Within Arizona, Phoenix has more people than Tucson. The formula lists each sort column in sort priority and the type of sort to apply to it.

Sort example

See Also

Power Query for Excel Help

Sort columns (docs.com)

Need more help?

Expand your Office skills
Explore training
Got It
Get instant Excel help
Connect to an expert now
Subject to Got It terms and conditions

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×