How to have multiple column sorts in Power BI desktop/online with directquery

11,511

From the Query Editor, sort by one column then edit the formula to include the second column like this...

= Table.Sort(#"Reordered Columns1",{{"OrdersCount", Order.Descending},{"OrderDate", Order.Descending}})

You must comma-delimit each column header and ordering option within curly braces.

Example:

{{"1st_Sorted_Column_Header",Order.Ascending},{"2nd_Sorted_Column_Header",Order.Descending},{"3rd_Sorted_Column_Header",Order.Descending}}
Share:
11,511
ivric
Author by

ivric

Updated on July 23, 2022

Comments

  • ivric
    ivric almost 2 years

    I have matrix visualization with multiple columns say:

    ProjID ProjName Budget Proj_Status project_duration

    I want to do a multiple column sort (like in Excel) first on Budget then on Project_duration in Power BI.