web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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,
 
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,493 Super User 2025 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard