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

Filter Data in Data table by Date

Hello,

 

I would like to only show data in the Data Table from the present day. I.e. I do not want entries from days ago showing up on the power app otherwise the size of the table will be enormous. I still want this old data on sharepoint, just not displayed currently on the power apps.

 

Is there a specific formula I need to type under the "items" section?

I was thinking something along the lines of: Filter(Table, Date = Today()) however this does not work.

 

Any suggestions?

 

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions

If you can keep the list item count under 2,000 by deleting old records it should continue to work.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

11 REPLIES 11
Super User II
Super User II

This may sound weird but try it in this order:

 

Filter(DataSource, Today() = StartDate)

Otherwise this should work

 Filter(DataSource, Text(StartDate, DateTimeFormat.ShortDate) = Text(Today(), DateTimeFormat.ShortDate))


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Memorable Member
Memorable Member

I would also rename the column Date if your column is named Date in sharepoint

Thank you for that!

 

It does filter correctly when I have the command: Filter(DataSource, Date = Today()) however, a blue icon comes up on the left hand side corner saying: 'Suggestion: Part of this Filter formula cannot be evaluated remotely due to service limitations. The local evaluation may produce suboptimal or partial results. If possible, please simplify the formula. For more information, please see the Filter function documentation'.

 

Any idea how to fix this please?

 

Thanks 

 

 

Also, any idea how I could include today's date and yesterday's too? I.e. how I would write that Filter command in the "items" section?

 

Thanks so much 

Memorable Member
Memorable Member

I would bet the error you are having is due to the column name. Date is a function in PA so it might causing problem there. Another reason might be that the format of the date in your sharepoint is incorectly formated which can be fixed as @Jeff_Thorpe mentioned above.
To include also yesterday just add
|| Today()-1
in your filter function
Memorable Member
Memorable Member

|| DateColumn = Today()-1

Hi. that is because the filter and today() functions and their interaction with the delegation capabilities of PowerApps.  You should not use that function multiples times because that functions works locally and it will not work well if your data table filter o query returns more than 500 records. My recommendation is to preload the today() value in a global variable or to create a collection only if you are working with + 500 records. More information about delegation here:  https://docs.microsoft.com/en-us/powerapps/delegation-overview#blue-dot-suggestions and https://docs.microsoft.com/en-us/powerapps/delegation-list

GLUP - Creating Links - www.glup.com.co

 

Thanks for that!

 

Given I will be dealing with 500+ records  (not presently however the app is a form that will be submitted daily to Sharepoint, thus will reach 500+ records as time goes by), how do you suggest I "preload the today () value in a global variable"? I understand to create a global variable I need to set the value in the form: Set( MyVar, 1). What would you suggest the formula for this would be? 

If you data list is over 500 but under 2,000 you could try a new feature that allows you to adjust the delegated row limit up to 2,000. Here is a blog post about the new feature.

 

PowerApps data row limit for non-delegable queries



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (13,576)