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 / 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

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard