cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chris4325
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
KroonOfficeSol
Resident Rockstar
Resident Rockstar

@chris4325 

 

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

View solution in original post

4 REPLIES 4
alrez
Community Support
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.

KroonOfficeSol
Resident Rockstar
Resident Rockstar

 

 

 

KroonOfficeSol
Resident Rockstar
Resident Rockstar

@chris4325 

 

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

 Hi Paul,

 

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

 

Thx Chris

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (4,554)