Order by using two columns

I have two columns that I want to apply order by on :

  1. The first column is Year. I’d like the data table to be ordered by Year in descending order.
  2. The second column is the department code - example Environment ENV, Humain Resources HR etc.

My data table has severals columns. So the aim to is to order firstly by Year in descending order followed by an order by on the Department Code column in ascending order. So for a given year, example 2019, I should have Department codes listed as ENV, FIN, HR, IT etc.

I was able to order the column Year in descending order but the department was not listed in the correct order as I would like.

Thank you all in advance


I would suggest doing this in Power Query, where you can easily sort on any combination of columns in any mix of ascending/descending you want. Then when you’re done sorting, you can add an index column, which willl easily let you return to the original sort order.

  • Brian

Cool, thanks Brian I’ll try that