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 / Ensure one datepicker ...
Power Apps
Answered

Ensure one datepicker is before the other

(1) ShareShare
ReportReport
Posted on by 801

Hi all,

 

Quick question,

I have 2 datepickers on my screen and I need to ensure that the Start date is before than the expiry date, I can't seem to figure it out.

Any ideas?

Categories:
I have the same question (0)
  • Verified answer
    Manish Solanki Profile Picture
    15,167 Moderator on at

    Hi @RJM07 

     

    Please enter the following formula on the "OnChange" property of Start Date datepicker control:

     

    If(Self.SelectedDate >= enddate.SelectedDate,Notify("Start date should be less than end date"));Reset(Self);

    If start date is more than or equal to end date then it will notify the user and reset to default value. If you want to make start date as blank then set "DefaultDate" property to no value.

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

    Thanks

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I can think of 2 solution.

    The new date picker (actually there are 2 new date pickers, one in canvas apps, and one in Teams app and components. The Teams/Component has this feature, the other has not. You have to go to setting in your app to turn them on. Search modern controller. To add it to a Canvas app, start a new component, add it to the "app" and copy it and paste it into you canvas app.

     

     

    The new date picker is way better than the old, but keep in mind its not datePicer.SelectedDate, but DatePicker.Value and some other minor changes. 

     

    In advanced you can set minimum date or something like that, locking the ability to select date before that time. This could be from input from another date picker as you need. 

     

    Old fashion solution

    The other solution is to change color to date text to red if it is < StartDate.SelectedDate, add a warning text (if you want) and disable the "save button" if endDate.SelectedDate < StartDate.SelectedDate

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard