Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
robmarsh
Helper I
Helper I

Column Sorting in Direct Query

Hi,

 

Hoping someone can help point me in the right direction, I'm pretty sure I am missing something obvious as what I am trying to achieve is pretty straight forward. However, my searches on the forum posts have not brought up any solutions.

 

So, I have a Direct Query that I want to sort on multiple columns within the query itself. I then want to display the results in a table and apply the same sorting as embedded into the Direct Query SQL code. However, I can't seem to get it to work at all.

 

I can't sort the columns in the Edit Query window as this fucntionality isn't supported when using a Direct Query. Neither can I add the columns to the table (even though I dont want to see them) and sort there as it only seems to support sorting on one column at a time.

 

Thanks for looking 🙂

2 REPLIES 2
JirkaZ
Solution Specialist
Solution Specialist

@robmarsh Are you using a custom SQL command to connect to the SQL data? With this option sorting is not allowed as you can specify it in the command. 
If you'd use the SQL browser and select the tables you need, then sorting would be allowed and offloaded to the SQL Server.

@JirkaZ thanks for the reply. Yes I am using a custom SQL command, and I am already applying the column sorts in that command. This is why I am confused as to why or how it is deciding to sort by something else, or just ignore my sorting completely.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.