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 / Why filtering a datave...
Power Apps
Answered

Why filtering a dataverse datetime value gets delegation warning?

(0) ShareShare
ReportReport
Posted on by 7

Hi all,

 

I am trying to filter a datetime column in the dataverse table. Below is what I have done.

 

I created a global variable equals today:

Set(gblSelectedDate, Today())

 

For the "Items" of a gallery, I set it to:

Filter('Bookable Resource Bookings', DateValue(Text('Start Time')) = gblSelectedDate)

 

A delegation warning showed up as below:

Delegation Warning.png

 

I checked and found that the filter function of a datetime field should be delegable for dataverse. However, there is a remark (Number 3) about exception of using Today().

Dataverse Delegable Functions and Operations.png

 

May I know what can I do to avoid the delegation issue? Any explanation/fix to the issue would be much appreciated, thanks.

 

Regards,

Ivan

 

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @IvanLee ,

     

    To avoid delegation warning, suggest you to create a collection. In your case, you can collect the data on the OnVisible property using the formula below:

    ClearCollect(colBookings,'Bookable Resource Bookings')

    And then update your gallery information to:

    Filter(colBookings,DateValue('Start Time')=gblSelectedDate)

    Hope this helps.

  • IvanLee Profile Picture
    7 on at

    Hi @Anonymous 

     

    Thanks for the suggestion but do you know why filtering the table directly will cause the warning? I am trying to understand it and prevent this happening again in my future PowerApps development life. Thanks.

  • Verified answer
    timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @IvanLee 


    Assuming that 'Start Time' is the target column in your table, DateValue(Text('Start Time')) is the part that causes the delegation warning. Dataverse isn't able to carry out the data type conversions with the Text and DateValue functions and therefore, the PowerApps client has to carry out this operation on all source recrods, which results in the non-delegable query that you see.

    The way I would approach this problem (eg, to filter source values that contain a time component, against an input date only), is to use the greater and less than operators. The formulas you would use would look something like this:

    Set(gblDateToday, Today())
    Set(gblDateTomorrow, DateAdd(gblDateToday, 1, Days))
    
    
    Filter('Bookable Resource Bookings',
     'Start Time' >= gblDateToday &&
     CreateDateTime < gblDateTomorrow
    )
    
    

    If possible, I would recommend against populating a collection with all the records in your table and to filter locally. If you have a large number of records in table, this will be very slow.

  • IvanLee Profile Picture
    7 on at

    Thanks @timl !

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard