web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do I get this to s...
Power Apps
Answered

How do I get this to sort numerically, lowest to highest?

(0) ShareShare
ReportReport
Posted on by 437 Super User 2024 Season 1

SortByColumns(Filter(BusAvailability, Sunday = "true" || Monday = "true" || Tuesday = "true" || Wednesday = "true" || Thursday = "true" || Friday = "true" || Saturday = "true"), "BusNum", SortOrder.Ascending)

 

BrianM_0-1711396641443.png

 

Categories:
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    Is the busnum column text not value? If it IS a value column, not text simple

    Sort(listName, columnName,SortOrder.Ascending)

    works fine, if not I would prob do a a

    Sort(AddColumns(listName, "sortable", Value(columnName)),sortable,SortOrder.Ascending)
  • Brian-M Profile Picture
    437 Super User 2024 Season 1 on at

    Yes, it is Text so your second option worked perfectly.  Thanks!

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Brian-M,

     

    I expect the column to be of type text, which leads to the unexpected sorting of the numbers. You can use the following code to sort it as a number column (type cast Bus Num to a number column). Do keep in mind that this will make the function non-delegable.

     

    Sort(
     Filter(
     //Your code here
     ), 
     Value('Bus Num'), 
     SortOrder.Ascending
    )

     

    I hope this helps!

     

    Edit: Only now saw the previous responses - @TheRobRush's code will indeed do the trick. 😊

  • Brian-M Profile Picture
    437 Super User 2024 Season 1 on at

    Thank you @LaurensM, both solutions posted work.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard