cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User II
Super User II

Re: Filtering Dates to include next year

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
Highlighted
Super User
Super User

Re: Filtering Dates to include next year

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.

 

Highlighted
Advocate I
Advocate I

Re: Filtering Dates to include next year

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.

Highlighted
Super User
Super User

Re: Filtering Dates to include next year

Try using Now() instead of Today()

Sort(Filter(Events, 'End Date' > Now()),'End Date', Ascending)
Highlighted
Super User II
Super User II

Re: Filtering Dates to include next year

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

Highlighted
Advocate I
Advocate I

Re: Filtering Dates to include next year

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

Highlighted
Super User II
Super User II

Re: Filtering Dates to include next year

@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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,229)