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 Apps
Answered

Sort by an order

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

Is it possible to order a gallery by a priority? I've tried using sort, but the only option is ascending and decending and as my proirities are ["Low","Medium","High"] either option doesn't give me this. 

 

This is my current formula for this:

If(Sort_gallery.Selected.Value = "Priority", Sort(Filter('Support issues',Closed = false),Priority.Value,Descending),Sort(Filter('Support issues',Closed = false),Date))

Categories:
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Switch(Sort_gallery.Selected.Value,

    "Priority",

    Sort(Filter('Support issues',Closed = false),

    Sort(Filter('Support issues',Closed = false),Date))

  • eka24 Profile Picture
    20,925 on at

    Consider this:

    If(Sort_gallery.Selected.Value = "Priority", SortByColumns(Filter('Support issues',Closed = false),Priority,["Low","Medium","High"] )
    ,Sort(Filter('Support issues',Closed = false),Date))

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Verified answer
    timl Profile Picture
    37,409 Super User 2026 Season 2 on at

    @Anonymous 

    Just to clarify your requirement, you want to sort your gallery so that the records that are marked as high appear at the top of the list, followed by those that are marked medium, and finally those that are marked low.

     

    Your formula doesn't work right now because you're sorting alphabetically by the priority text in descending sequence, which means that medium appears at the top of the list, followed by low, then high.

    If that's the case, you would need to convert the priority text values to a number and then sort by the number. This is the formula that you would use.

     

    If(Sort_gallery.Selected.Value = "Priority", 
     Sort(Filter('Support issues',Closed = false),
     Switch(Priority.Value,
     "High", 1,
     "Medium", 2,
     "Low", 3
     ),
     Ascending
     ),
     Sort(Filter('Support issues',Closed = false),Date)
    )

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