Skip to main content

Notifications

Power Apps - Building 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

 

  • MJ84 Profile Picture
    MJ84 263 on at
    Re: SortByColumns and Sort Together

    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)

  • philifova Profile Picture
    philifova 125 on at
    Re: SortByColumns and Sort Together

    Still the same 😞

  • MJ84 Profile Picture
    MJ84 263 on at
    Re: SortByColumns and Sort Together

    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
    philifova 125 on at
    Re: SortByColumns and Sort Together

    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
    MJ84 263 on at
    Re: SortByColumns and Sort Together

    can you paste your code?

  • philifova Profile Picture
    philifova 125 on at
    Re: SortByColumns and Sort Together

    Mine It says invalid argument.

  • MJ84 Profile Picture
    MJ84 263 on at
    Re: SortByColumns and Sort Together

    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

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard