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

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)

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,004)