cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
J_Hazel
Level: Powered On

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

Re: Filter Data in Data table by Date

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

Re: Filter Data in Data table by Date

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.
Sienna
Level 10

Re: Filter Data in Data table by Date

I would also rename the column Date if your column is named Date in sharepoint
J_Hazel
Level: Powered On

Re: Filter Data in Data table by Date

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 

 

 

J_Hazel
Level: Powered On

Re: Filter Data in Data table by Date

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 

Sienna
Level 10

Re: Filter Data in Data table by Date

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
Sienna
Level 10

Re: Filter Data in Data table by Date

|| DateColumn = Today()-1
JavoMejia
Level: Powered On

Re: Filter Data in Data table by Date

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
J_Hazel
Level: Powered On

Re: Filter Data in Data table by Date

 

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? 

Super User
Super User

Re: Filter Data in Data table by Date

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,762)