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

View solution in original post

 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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,952)