ivric
ivric

Reputation: 109

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

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.

Upvotes: 3

Views: 11798

Answers (1)

point71echo
point71echo

Reputation: 330

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}}

Upvotes: 5

Related Questions