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 / Trying to compare Date...
Power Apps
Answered

Trying to compare DateValue and DateTimeValue

(0) ShareShare
ReportReport
Posted on by 134

The code below resulted in a delegation warning.

Filter('Dataverse Name', 'Minimum date calendar'.SelectedDate < DateValue('Created On') && DateValue('Created On') < 'Maximum date calendar'.SelectedDate)

 

The delegation warning is caused by the having 'Created On' nested within two functions the inner most function trying to convert it from a DateTimeValue to just a date format.

 

The code below is an alternative version I tried to avoid the delegation warning. Here instead of trying to convert the 'Created On' to a date format I am trying to convert the selected date to a DateTimeValue.

 

Filter('Par Numbers', DateTimeValue('Minimum date calendar'.SelectedDate) < 'Created On' && 'Created On' < DateTimeValue('Maximum date calendar'.SelectedDate))

 

But it did not seem to work as the table did not populate the gallery.

 

 

DateTimeValue('Minimum date calendar'.SelectedDate) = 1/1/2022, 12:00:00 AM 

 

The values in the 'Created On' column are in the form 4/8/2022 12:55 PM

 

1/1/2022, 12:00:00 AM and 4/8/2022 12:55 PM might not be comparable due to the function that converts date to DateTimeValue seems to put a comma into it.

 

  • Verified answer
    AhmedSalih Profile Picture
    6,680 Moderator on at

    @G0Springs , correct your formula to have the 'Created On' before DateTimeValue('Minimum date calendar'.SelectedDate) :

    Like this:

     

     

     

     

    Filter('Par Numbers', 'Created On' > DateTimeValue('Minimum date calendar'.SelectedDate) && 'Created On' < DateTimeValue('Maximum date calendar'.SelectedDate))

     

     

    Also, you can get rid of the DateTimeValue function if you change the property of the Date pickers to .ShortDateTime:

    AhmedSalih_0-1655919807011.png

     

     

     

     

    Regards,
    Ahmed
    If my reply helped you, please give a 👍. And if it has solved your issue, please consider Accept it as the Solution to help other members in the community find it more.

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 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard