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 / Delegation Warning whe...
Power Apps
Answered

Delegation Warning when filtering a gallery by a date

(0) ShareShare
ReportReport
Posted on by 6
Hi
 
I have a gym workout app and I am trying to filter a gallery to show records where the Session Date column (A date only column) is equal to a variable called gblTextSelectedDate. 
 
I currently have:
 
Filter('Workout Sessions','Member Name'.'Member Name'=gblTextCurrentUser && Text('Session Date',"dd-mm-yyyy") = gblTextSelectedDate)

this is producing a delegation error and saying the "filter" part may not work correctly on large data sets
I have the same question (0)
  • Verified answer
    MS.Ragavendar Profile Picture
    7,431 Super User 2026 Season 1 on at
    @CU26020123-0, Try this formula
     
    With(
        { d: DateValue(gblTextSelectedDate) },
        Filter(
            'Workout Sessions',
            'Member Name'.'Member Name' = gblTextCurrentUser &&
            'Session Date' >= d &&
            'Session Date' < DateAdd(d, 1, Days)
        )
    )
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
  • WarrenBelz Profile Picture
    155,840 Most Valuable Professional on at
    Firstly @MS.Ragavendar is correct, so please mark that accordingly.
     
    Some explanation for your future reference - datasources (I assume SharePoint here, but applies to all) will not delegate data structure conversions inside a Filter (they will not look at the date field, convert it in all records into Text, then do a comparison with a Text value you supply). You need to do it the other way around - convert the Text value to a Date and then compare it with the Date field in the data source. You also need to keep any calculations out of the filter (hence the "pre-conversion" in the With statement provided).
  • CU26020123-0 Profile Picture
    6 on at
    @MS.Ragavendar Thank you so much!!!! This worked a treat I had to amend the "session date < DAteAdd" part as the delegation warning appeared again but I created another scope within the With function and then inserted it replaced the "Session date < DateAdd" part of the filter. This has worked a treat!!!!! Much appreciated
  • CU26020123-0 Profile Picture
    6 on at
    @WarrenBelz Ah I see thank you for your reply. No this was a table in dataverse which made things even stranger, because you're correct reading around these errors were commonly seen with SharePoint data sources. Just so I have this straight I needed to convert my variable to a date and then compare it with my Date column in Dataverse. And when you do calculations in a filter, delegation warnings can appear which therefore means its best practice to use a With statement to declare the scope which is used in the filter?
  • WarrenBelz Profile Picture
    155,840 Most Valuable Professional on at
    Yes that is a fairly accurate summary, essentially Dataverse will not do field type transformations for you and then filter the result - either you do that locally (non - Delegable query which has the limited dataset come back and then filtered on the local device) or what you have now,

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard