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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
J_Hughes83
Regular Visitor

Rows not sorting properly

I have a dataset with a column called row number that is imported from the smartsheet, the row number runs from 1-1901, incremeting by 1. In PowerQuery it loads in numeric order. In the Data Model, it usually starts at 649 and has random groupings, usualy 10-20 numbers in order in a row, then it jumps to some other set of numbers, I have had it start with several different numbers, occasionally I have had it change just by me saving the query.

 

J_Hughes83_0-1705010763737.png

J_Hughes83_1-1705010871416.png

 

 

I am trying to display the data in the Microsoft Gantt visual in numeric order by the row number column, but it is showing in the order in the Data table.

 

I added an index and tried to sort my row number column by the index in the data model, but it still sorts starting at 649. Sorting the row number column by ascending puts the rows in the correct order in the table view, but does not change the order in the visual. How can I get this to sort in order so it shows in the proper order in the visual?

6 REPLIES 6
hvnter
Resolver I
Resolver I

Make sure the column you're sorting by, isn't sorted by something else 

is there a way to see and/or clear what is sorting by what?

Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

lbendlin
Super User
Super User

Neither Power Query nor Power BI give any sorting guarantee unless you specify how you want stuff sorted.  Adding the index is the right first step.  Next step is to use the "Sort one column by another column"  feature.

I did use the sort by column option, I used the index to sort the row # column and it still starts with 649

HotChilli
Super User
Super User

Are you using 'sort by column' functionality?

I haven't used the Gantt visual but this is what you need.  Try testing it in another visual type if you can't get it to work in the Gantt.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.