cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Xinlin
Helper II
Helper II

Combine Sort and Filter

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Matren
Responsive Resident
Responsive Resident

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

View solution in original post

2 REPLIES 2
Matren
Responsive Resident
Responsive Resident

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

That actually works, thanks a lot Matren!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,383)