cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MartySt
Helper I
Helper I

PowerApps Default Sorting with Values

Hello,

 

I have a set of data that is sorted by a column called DataOrder. It is numbered from 1 through 12, see table below for example. The Issue I'm having is that powerapps does not sort it in the way I would expect, from 1 to 12 in order, it actually sorts like this:

1,10,11,12,2,3,4,5,6,7,8,9

 

This is incredibly annoying, since I specifically put in a column called DataOrder to order my data in the way you would expect...

It works the way you would expect for a data set less than 10, since it counts from 1 to 9 and then that's it.

Here is my code for reference: Sort(Table1,DataOrder,SortOrder.Ascending)

 

Does anyone know how I can fix this?

 

 

 

 

DataOrder

1
2
3
4
5
6
7
8
9
10
11
12
1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

The problem is that your DataOrder column is a string data type and not an integer.  So the column is sorting alphabetically rather than numerically.  Change the Data type on the column and it should work correctly.  If the list isn't a large one you should also be able to try this formula.  But it won't be delegable.

Sort(Table1,Value(DataOrder),SortOrder.Ascending)

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User III
Dual Super User III

The problem is that your DataOrder column is a string data type and not an integer.  So the column is sorting alphabetically rather than numerically.  Change the Data type on the column and it should work correctly.  If the list isn't a large one you should also be able to try this formula.  But it won't be delegable.

Sort(Table1,Value(DataOrder),SortOrder.Ascending)

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

This worked! 

 

Thanks so much.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,189)