cancel
Showing results for
Did you mean:
Frequent Visitor

## Independent filtering and sorting of a Gallery

Hi,

I want to filter and sort my gallery.

My filter options are: All, Having comment, Being Overdue,  Having follow up date. The chosen option is put into a variable FilterVar

Also I want to sort: Invoice date, Due date, Amount, Follow up date. The chosen option is put into a variable SortVar

From my mathematical understanding there are 16 combinations.

My idea was to first apply the filter statement to the item gallery and then as a chained command the sort statement

If(FilterVar=1; Sammlung2; If(FilterVar=2; Filter(Sammlung2; !IsBlank(Bemerkung)); If(FilterVar=3; Filter(Sammlung2; Delta>14))));; Sorting...

But this does not work.

I understand that I could use nested filtering and sorting. However, this would be a very big expression (16 combinations).

Any ideas, how to make this happen in a nice way?

Thx Christian

1 ACCEPTED SOLUTION

Accepted Solutions
Resident Rockstar

Your approach is a bit off.

Try something like this:

SortByColumns(
Filter(
Sammlung2
,Or(
FilterVar = 1
,And(FilterVar = 2, !IsBlank(Bemerkung))
,And(FilterVar=3, Delta>14)
)

)
, SortVar
, Ascending
)

Hope this helps you solve this.

Paul

4 REPLIES 4
Community Support

Hi,

The only way I can think of is the nesting solution way. I would give that a try and if it doesn't work for you I would consider opening a ticket with Microsoft Support. Unfortunately it is fairly uncommon that someone wants to filter as much as you. I will include a link below; on how to open a ticket with Microsoft Support. Otherwise if any other communities members might know feel free to chime in.

If you would like to create a ticket with Microsoft Customer Support here is a link on how to do so: https://docs.microsoft.com/en-us/power-platform/admin/get-help-support

Regards,

Alex

-------

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Resident Rockstar

Resident Rockstar

Your approach is a bit off.

Try something like this:

SortByColumns(
Filter(
Sammlung2
,Or(
FilterVar = 1
,And(FilterVar = 2, !IsBlank(Bemerkung))
,And(FilterVar=3, Delta>14)
)

)
, SortVar
, Ascending
)

Hope this helps you solve this.

Paul

Frequent Visitor

Hi Paul,

great, I did not know the SortByColumn function which allows for filtering and sorting independently. This is what I needed 🙂

Thx Chris

Announcements

#### April 4th Copilot Studio Coffee Chat | Recording Now Available

Did you miss the Copilot Studio Coffee Chat on April 4th? This exciting and informative session with Dewain Robinson and Gary Pretty is now available to watch in our Community Galleries!   This AMA discussed how Copilot Studio is using the conversational AI-powered technology to aid and assist in the building of chatbots. Dewain is a Principal Program Manager with Copilot Studio. Gary is a Principal Program Manager with Copilot Studio and Conversational AI. Both of them had great insights to share with the community and answered some very interesting questions!     As part of our ongoing Coffee Chat AMA series, this engaging session gives the Community the unique opportunity to learn more about the latest Power Platform Copilot plans, where we’ll focus, and gain insight into upcoming features. We’re looking forward to hearing from the community at the next AMA, so hang on to your questions!   Watch the recording in the Gallery today: April 4th Copilot Studio Coffee Chat AMA

#### Launch Event Registration: Redefine What's Possible Using AI

Top Solution Authors
Top Kudoed Authors
Users online (4,322)