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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Combine Sort and Filter
Power Apps
Answered

Combine Sort and Filter

(0) ShareShare
ReportReport
Posted on by 82

Hi all, 

 

I've a gallery that intended to filter with two dropdown selection and I would like to sort by created date as well. The filter and sort formula works well separately but it came back with errors when I tried to combine it. 

 

Here's the filter formula: 

 

 

Filter(
 AccountOpenings, 'Status (crf38_status)' = ddStatus.Selected.Value && 
 Instrument.'Instrument (crf38_instrument)' = ddInstrument.Selected.'Instrument (crf38_instrument)')

 

 

 

Here's the sort formula: 

 

 

SortByColumns(AccountOpenings,"createdon", If(SortDescending1,Ascending,Descending))

 

 

 

The attempt to combine both formulas but came back with errors: 

 

 

SortByColumns(Filter(AccountOpenings, 'Status (crf38_status)' = ddStatus.Selected.Value && Instrument.'Instrument (crf38_instrument)' = ddInstrument.Selected.'Instrument (crf38_instrument)'),'Created On', If(SortDescending1,Ascending,Descending))

 

 

How can I combine the formulas to make it work? Thank you. 

Categories:
I have the same question (0)
  • Verified answer
    Matren Profile Picture
    454 Super User 2024 Season 1 on at

    Hi @Xinlin ,

     

    I noticed that you used "createdon" in the Sort formula that worked and 'Created On' in the combined version. Try using the same column name in the Sort formula that worked (i.e. "createdon") for the combined formula.

     

    Let me know how it goes.

     

    Best Wishes,

     

    Matren

     

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

    Find this post helpful, give it a Thumbs Up

    Solved your problem, click Accept as Solution so others can find it

  • Xinlin Profile Picture
    82 on at

    That actually works, thanks a lot Matren!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 445

#2
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 321 Super User 2025 Season 2

Last 30 days Overall leaderboard