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 / SortByColumns and Sort...
Power Apps
Unanswered

SortByColumns and Sort Together

(0) ShareShare
ReportReport
Posted on by 125

Hello I have a Gallery that needs to be sort by STATUS and DATE

 

The left one is the raw and the right side should appear on gallery.

 

philifova_0-1677043696396.png

 

What code should I use? I'm currently using SortByColumns

 

Categories:
I have the same question (0)
  • MJ84 Profile Picture
    263 on at

    Hello you are using the right function so in mine I have a column called Date and one called Title..... Because I have put Date first it will sortby the date first then the title.

     

    MJ84_0-1677045442311.png

     

    If this was helpful please mark as answered 🙂

     

    Thanks

     

    M

     

  • philifova Profile Picture
    125 on at

    Mine It says invalid argument.

  • MJ84 Profile Picture
    263 on at

    can you paste your code?

  • philifova Profile Picture
    125 on at

    SortByColumns(Filter(myDB, If(IsBlank(myRequestAssignedToMe), Status= "Open" Or Status= "In Progress", User= myRequestAssignedToMe)), "Status", ["In Progress","Open", "Returned", "Fulfilled", "Completed", "Cancelled"] "DUEDATE", Descending)

  • MJ84 Profile Picture
    263 on at

    I think you are just missing a comma after "Cancelled"] -- try the below 

     

    SortByColumns(Filter(myDB, If(IsBlank(myRequestAssignedToMe), Status= "Open" Or Status= "In Progress", User= myRequestAssignedToMe)), "Status", ["In Progress","Open", "Returned", "Fulfilled", "Completed", "Cancelled"], "DUEDATE", Descending)

  • philifova Profile Picture
    125 on at

    Still the same 😞

  • MJ84 Profile Picture
    263 on at

    It looks like using sortbycolumns doesn't like you sorting by multiple criteria if you use a bespoke order like you are... Try the below this worked for me on my dataset 

     

    Sort(SortByColumns(Filter(myDB, If(IsBlank(myRequestAssignedToMe), Status= "Open" Or Status= "In Progress", User= myRequestAssignedToMe)), "Status", ["In Progress","Open", "Returned", "Fulfilled", "Completed", "Cancelled"]), "DUEDATE", Descending)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard