web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter on Date Picker ...
Power Apps
Unanswered

Filter on Date Picker not working

(0) ShareShare
ReportReport
Posted on by 64

I have a canvas app connected to a Sharepoint list. I have a data table called datatable3. This has two columns: endproduction time and addedby. Endproductiontime is text.

On the same screen as the data table, I have a date picker called datepicker1. When the user clicks a button called barcodescanner2_1, it's onscan property is: set(barcodehistory,barcodescanner2_1.value).

Once the user scans a barcode, I want the data table to filter to only matching barcodes of that type that were scanned between today and the last 60 days.


For some reason, when I choose 12/1/2022 as the date in the datepicker, the table is sorted perfectly and returns the correct results ranging from October - December. When I choose 1/1/2023, however, it only returns one result, which is 11/21/2022. The table will not return any results after 11/21/2022. Nothing scanned in December 2022 or January 2023 is populating in the table. 

 

Here's the formula: 

SortByColumns(
 Filter(
 AddColumns(
 'Data',
 "_EndProductionTimeDATE",
 DateTimeValue(EndProductionTime)
 ),
 DateTimeValue(EndProductionTime) < DatePicker1.SelectedDate && 
 DateTimeValue(EndProductionTime) > 
 DateAdd(
 DatePicker1.SelectedDate,
 -60,
 Days
 ) && 
 Title in Barcodehistory
 ),
 "_EndProductionTimeDATE",
 Descending
)
Categories:
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @pgd ,

     

    The formula is not delegable , please check whether there are more than 500 records in the SP list.

     

    If the number of records does not exceed 2000, then you can manually modify the delegation data row limit from 500 to 2000.

    vxiaochenmsft_0-1673316200191.png

     

    If the number of records exceeds 2000, we recommend that you consider using delegable formula replacements.

     

    I think this link will help you a lot:
    Understand delegation in a canvas app - Power Apps | Microsoft Learn

     

    Best Regards,

    Wearsky

  • pgd Profile Picture
    64 on at

    @v-xiaochen-msft I currently have 454 records, but I know this will soon exceed 500. How can I edit my formula so that it's delegable? 

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @pgd ,

     

    First,you need to create a new datetime column in 'Data', and replace "EndProductionTime" with the new datetime comlum, cause AddColumns/DateTimeValue/SortByColumns/in are not delegable , you need to compare a datetime value with a date time column.

     

    Second, you could try this formula

     

    Sort(

       Filter(

             'Data',

              NewDataTimeColumn < DatePicker1.SelectedDate &&

              NewDataTimeColumn > DateAdd(DatePicker1.SelectedDate,-60,Days) &&

              Title = Barcodehistory

        ),

       NewDataTimeColumn,

       Descending

    )

     

    Best Regards

    Wearsky

  • pgd Profile Picture
    64 on at

    @v-xiaochen-msft Would I add the column to the powerapp or the sharepoint list? If the answer is the powerapp, can you tell me where I should add it? Thanks. 

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @pgd , 

     

    Add a column to the Sharepoint list.

     

    Best Regards,

    Wearsky

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard