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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
DmitryKo
Helper IV
Helper IV

"Sort by column" not working if column is set as a key column

The setup is usual, e.g. a status table where status names have to be sorted (on visuals) according to their positions in the process. For example table "D_Status":

 

StatusOrderNum
New1
In Progress5
Done100

 

Now if we go go the table properties, select "Status" column, expand "Advanced", and in "Sort by column" select "OrderNum" column - it would sort by OrderNum (numeric) instead of alphabetical sort by Status (text).

Thing is, this stops working the moment you set "Status" column as a "Key column" in a table's properties. Just try changing this one setting on and off, and see sort by other column switching between working and not working.

Why?

3 REPLIES 3
lbendlin
Super User
Super User

A key column is assumed to be unique and distinct, and one of its main purposes is serving as an index by sorting the rows (sometimes even physically, in case of a clustered index). Having the key column sorted by another column defeats that purpose.

"Having the key column sorted by another column defeats that purpose."

In that case, PBI D's UI should disallow using "Sort by column" feature for a column configured as table's key column, and/or give a warning when trying to do so. In the current state, it silently allows creating configuration that simply does not work as expected/advertised.

Being unique and distinct should not prevent anyone from sorting table's data by any other column (which is the reason the feature exists) if required by business scenario; it was never an obstacle with any relational (e.g. SQL) sources for years. It's a mystery why such a buggy implementation exists in PBI.

If you have a Pro license you can open a Pro ticket at https://admin.powerplatform.microsoft.com/newsupportticket/powerbi
Otherwise you can raise an issue at https://community.fabric.microsoft.com/t5/Issues/idb-p/Issues .

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors