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 / Sort gallery by if che...
Power Apps
Unanswered

Sort gallery by if checkbox is true and then days passed

(0) ShareShare
ReportReport
Posted on by 134

Hello,

 

I am trying to sort a gallery by if the checkbox is ticked sort to bottom and then sort the unticked by descending days passed. However when I attempt to do, it looks all over the place and sort doesn't seem to be right.

 

The formula I have is:

Sort(Sort(Filter(WorkCompletedList, "Invoiced" in JobStatus.Value),PaidYet.Value,Ascending),"DaysPast",Descending)

 

And the current result is:

 

Screenshot 2021-05-28 at 10.15.49.png

Categories:
  • nickellis74 Profile Picture
    432 Moderator on at

    You can use SortByColumns to do it in a single statement rather than nesting.

    SortByColumns(Filter(WorkCompletedList, "Invoiced" in JobStatus.Value),PaidYet.Value,Ascending,DaysPast,Descending)

    Also, I you've put DaysPast in " quote marks, which makes that a string rather than a column reference.

     

    If that works, let me know!

  • drossi Profile Picture
    134 on at

    Thanks @nickellis74 

    It seems it does not like the formula.

     

    Screenshot 2021-05-28 at 10.40.43.png

     

    'The function SortByColumns has some invalid arguments'

  • nickellis74 Profile Picture
    432 Moderator on at

    Yes, it's the PaidYet.Value that it doesn't like. Take out the '.Value' part, so it's just PaidYet. That might do it.

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard