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 / DatePicker with Minimu...
Power Apps
Suggested Answer

DatePicker with Minimum and Maximum date ranges

(1) ShareShare
ReportReport
Posted on by 388
Hi,
 
Is it possible to set max and min date ranges to select for date picker? Remaining dates should be greyed out. 
There are no MaxDate and MinDate properties for date picker control in PowerApps. Is there any other way to achieve this? Any suggestion would be greatly appreciated.
 
Thank you,
 
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,970 Super User 2026 Season 2 on at
    Hi,
     
    Yes, you can change the DefaultDate Property so that it doesn't allow you to do that.
     
    Example
     
    Let's pretend you do not want to go backwards more then 10 days and Forward more than 10 days from Today.
     
    You need to have "something" store the DefaultDate which acts as your starting point.
    So an Example
     
    In my OnVisible of the Screen, where this control exists I do this
     
    Set(_DefaultDate, Now());
     
    This will simply allow us to understand the initial date to subtract and add days too, too see if they are too far before or after the dates you want.
     
    In your DefaultDate Property of the DatePicker we need to do this
     
    If( DateDiff(Self.SelectedDate, _DefaultDate,TimeUnit.Days) > 10 days Or DateDiff(YourDate, Self.SelectedDate, TimeUnit.Days) > 10,
       _DefaultDate,
    );
     
    What the above does is, it checks to see if whatever date they picked is greater than 10 days in either direction.
    and if so resets it to the _DefaultDate from the Variable you create. If it is NOT greater than 10 then it lets them keep what they selected
     
    You can certainly create Environment Variables or some sharepoint config list, to store the Number, this way you can change it whenever.
          
    Cheers,
     
     
  • Ravindra Jadhav Profile Picture
    342 Moderator on at
    Thanks @Flmike
     
     
  • OK29 Profile Picture
    388 on at
    @FLMike, Thank you for your comments. I tried but I am getting error message that "A property cannot reference itself or other properties effected by its value" once I enter the below function in defaultdate property.
     
    This date picker is in a data control.
     
    Did you try this at your end?

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard