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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Powerwoman
Helper II
Helper II

Sorting in Power Query isn't applied to Desktop???

Hi there,
this is driving me crazy.

In Powerquery I created a sort order based on 2 different columns and afterwards I created an index column.

It's working fine with my test Excel but when connecting to SQL I'm completely loosing the sorting in Desktop.

Already tried to enable / disable 'enable load', save it, cleared cache, restarted Power BI Desktop, duplicate the query...

Any ideas are highly appreciated!

1 ACCEPTED SOLUTION
Powerwoman
Helper II
Helper II

Solved the problem myself...
I used the advanced options provided by the SQL Connector:

Powerwoman_0-1697638174330.png

 

 

 

View solution in original post

8 REPLIES 8
Powerwoman
Helper II
Helper II

Solved the problem myself...
I used the advanced options provided by the SQL Connector:

Powerwoman_0-1697638174330.png

 

 

 

Powerwoman
Helper II
Helper II

It seems like this topic is not new...
The column order in Data table isn't the same as i... - Microsoft Fabric Community
Please help, this is really a show stopper for me!

HotChilli
Super User
Super User

OK, still not quite clear.  Is the index created correctly for the sorted data in Power Query and this is purely a display issue in table view?

OR the index is created when the data is not correctly sorted in Power Query and therefore the data rows have incorrect index values?

--

There is no specific ordering in table view.  This is controlled by factors behind-the-scenes and cannot be depended on.  This should not affect measures as an index/date field can be used for cumulative measures.

Hi,
I'm using a measure that has a running total using the index.

RunningTotal2 =
CALCULATE(
    sum(fact_valueEntriesInbound[Item Ledger Entry Quantity]),
    fact_valueEntriesInbound[Index] <= max(fact_valueEntriesInbound[Index])
)
 
When I'm trying to use it in a visual performance  is really bad (+ 10 Min), this is the context I'm using.

Powerwoman_1-1697173389323.png

 

My theory is that the measure isn't working because the index column is not sorted correctly?
Wh does is start at 44700, not at 0 in the dataset? 

 

Powerwoman_2-1697173617866.png

 

HotChilli
Super User
Super User

What does "loaded correctly" mean? The index is created correctly but it doesn't display in order?

The index is created, but it in the table view it doesn't start at 0 but 44000.... 

HotChilli
Super User
Super User

Do you mean the data isn't sorted once it is loaded to powerbi front end (i.e. viewing it in Table view)? or the index is not created properly because Power Query sorting is not working?

Hi, 
it's not loaded correctly into the power bi front end (table view).
As I'm using measure function like earlier etc.. I need it to be sorted in a certain order. 
Thanx

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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