cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
forcedLightning
Advocate I
Advocate I

Filtering Dates to include next year

Hello all,

 

I have a SharePoint list with over 700 items used to house Event information. I'm creating a PowerApps dashboard of this information, and I want to filter it down to where End Date > Today for each item. I've done filters like this before, so I'm not sure why this one is giving me trouble. Here is my formula:

 

Filter(Sort(Events, 'End Date', Ascending), 'End Date' > Today())

 

The first record that should show in this formula would be in 2020, I'm wondering if that's why it's not showing anything? Screenshot below shows that this formula doesn't pull up anything. When I set to the opposite (End Date < Today()) it pulls up records just fine, all the way to the first ones created mid-2018.

 

Anyone have ideas why this wouldn't be working?

1 ACCEPTED SOLUTION

Accepted Solutions
Eelman
Community Champion
Community Champion

Just spitballing ideas here, have you set the 'Data Row limit for non-delegatable queries' to 2000?

 

You are getting a delegation warning meaning your query will only work on the limit set in the above. The default limit is 500 and with your dataset being 700 records if you haven't raised the limit then you'll only have access to 500 records. Maybe this is it?

 

Just a thought 🙂 

View solution in original post

6 REPLIES 6
EricLott
Resident Rockstar
Resident Rockstar

Try adding the DateValue() function to see if that helps.

 

Filter(Sort(Events, 'End Date', Ascending), DateValue('End Date') > Today())

Another syntax thing (unrelated to your issue) would be to move your Sort() function to the outside so you're only having to sort the filtered values instead of the entire unfiltered list. PowerApps may do this anyway, not sure if it prioritizes filters over sorts.

 

I'll change the order so that sort is on the outside, thanks for the tip!

 

Adding DateValue results in an error because the data is already of the Date type in SharePoint.

Try using Now() instead of Today()

Sort(Filter(Events, 'End Date' > Now()),'End Date', Ascending)
Eelman
Community Champion
Community Champion

Just spitballing ideas here, have you set the 'Data Row limit for non-delegatable queries' to 2000?

 

You are getting a delegation warning meaning your query will only work on the limit set in the above. The default limit is 500 and with your dataset being 700 records if you haven't raised the limit then you'll only have access to 500 records. Maybe this is it?

 

Just a thought 🙂 

Eelman, that was it!! You're an absolute lifesaver, I was racking my brain on this. Thank you so much!

@forcedLightning  happy to help 🙂

 

Just be mindful that if you've now set the limit to 2000 and the number of records in your SP List exceeds that new limit at some point then you'll start having the same issues again.

 

There are some good videos around about how to deal with delegation. I've just finished watching @RezaDorrani 's video series related to this which I found quite helpful, here's the link if you are keen

 

https://m.youtube.com/watch?v=gwiErbYtRdA&list=PLTyFh-qDKAiE6ia-D94Qk5-AzpN4dqOmD&index=1

 

 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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 (1,713)