cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OracleMicky
New Member

Trying to Descend with an already working Filter

Hi everyone,

 

Fairly new to Powerapps and have been working on a Project recently. Had some feedback which is great, however what I thought was simple, doesn't seem to work!

 

I am trying to get the Holiday Start date to descend by date alongside the filter. Any help would be greatly appreciated!

 

This is the code I have: Filter('Requests', 'Manager Email' = _CurrentUser.Email && (AllData.SelectedText.Value = "All" Or Title= AllData.SelectedText.Value) && Approved = "Approved" &&('Holiday Start Date' >= Today()|| ('Holiday Start Date' > Today() && ('Holiday End Date' >= Today())))) 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Mattheus
Regular Visitor

Hey, have you tried using Sort function?
That would be:

Sort (FILTER FUNCTION GOES HERE, 'Holiday Start Date', Descending)


Here's some more info about it: 
https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-sort

View solution in original post

iAm_ManCat
Super User
Super User

SortByColumns(
   Filter(
          'Requests',
          'Manager Email' = _CurrentUser.Email
          && 
          ( AllData.SelectedText.Value = "All" 
            ||
            Title= AllData.SelectedText.Value )
          &&
          Approved = "Approved" 
          &&
          ('Holiday Start Date' >= Today()
            || 
            ( 'Holiday Start Date' > Today() 
              && 
              'Holiday End Date' >= Today()
            )
          )
   ),
   'Holiday Start Date',
   Descending
)
@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

2 REPLIES 2
Mattheus
Regular Visitor

Hey, have you tried using Sort function?
That would be:

Sort (FILTER FUNCTION GOES HERE, 'Holiday Start Date', Descending)


Here's some more info about it: 
https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-sort

iAm_ManCat
Super User
Super User

SortByColumns(
   Filter(
          'Requests',
          'Manager Email' = _CurrentUser.Email
          && 
          ( AllData.SelectedText.Value = "All" 
            ||
            Title= AllData.SelectedText.Value )
          &&
          Approved = "Approved" 
          &&
          ('Holiday Start Date' >= Today()
            || 
            ( 'Holiday Start Date' > Today() 
              && 
              'Holiday End Date' >= Today()
            )
          )
   ),
   'Holiday Start Date',
   Descending
)
@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,231)