Skip to main content

Power BI

Needs Votes

Sort by another column in direct query

Vote (40) Share
Dave Gugg's profile image

Dave Gugg on 15 Sep 2016 21:18:31

Currently you can choose to sort based on another column, such as sorting a month name by the month number. However, this option does not exist in direct query mode. Please extend this functionality to direct query mode.

Comments (8)
Dave Gugg's profile image Profile Picture

danning 1234 on 06 Jul 2020 00:12:01

RE: Sort by another column in direct query

This functionality already exists. With a DirectQuery,
in Report Mode, you see no data, yes, but you can see the fields section, choose the column to be sorted, and you can find 'sort by column' is active, then, selection the sequence column to sort by.

Dave Gugg's profile image Profile Picture

Gary Thomann on 06 Jul 2020 00:09:53

RE: Sort by another column in direct query

Beef up the Matrix hierarchical sorting functionality as per:
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/11185431-add-a-multiple-columns-sort-featue 

Dave Gugg's profile image Profile Picture

Ryan on 05 Jul 2020 23:32:54

RE: Sort by another column in direct query

Sort by column appears for me using DirectQuery, but appears to be limited to non-calculated columns. So for example, I have a text column I'd like to sort in a specific way, and I've created a calculated column to specify the sort order. When I try to sort the text column by the calculated column I get an error saying: "This column can't be sorted by a column that is already sorted, directly or indirectly, by this column." This is no good. Please fix!!

Dave Gugg's profile image Profile Picture

Charles on 05 Jul 2020 23:27:31

RE: Sort by another column in direct query

This is NOT working for me in Direct Query. This sucks!

Dave Gugg's profile image Profile Picture

Power BI User on 05 Jul 2020 23:27:17

RE: Sort by another column in direct query

It's not working in direct query, in my scenario, the data is stored on-premise, and going through the DMG server.

Dave Gugg's profile image Profile Picture

Power BI User on 05 Jul 2020 23:27:17

RE: Sort by another column in direct query

Resolved, was connecting to the power BI Service dataset that is connecting to on-premise SQL Server through DMG. So if I build a new report by connecting to the Power BI Service dataset, then this sort by column is disabled.

So what I have done is to configure that in the Power BI Desktop that connect directly to the SQL Server, made the configuration in the data model and then re-publish into Power BI Service.

Dave Gugg's profile image Profile Picture

Andrew Peterson on 05 Jul 2020 23:14:26

RE: Sort by another column in direct query

This functionality already exists. With a DirectQuery, in Report Mode, in the fields section, highlight the column to be used as the display value, such as 'Month'. Next Under the Modeling menu item, select 'Sort By Column'. Switch the sort by column to the column to be used, such as MonthNumber.

Dave Gugg's profile image Profile Picture

Matthew Chapman on 05 Jul 2020 22:32:51

RE: Sort by another column in direct query

I am all for this enhancement. In the meantime you have to build the field so it would sort correctly as an alpha field. For example day of week you would have to build the value like this: "10, 21 Fri", "10, 22 Sat", "10, 23 Sun", etc...