Restrict Selection of Future Dates in PowerApps Date Picker

Presently there is no way of preventing users selecting future dates using the properties of the PowerApps date picker control. Fortunately we can overcome this limitation using a simple formula.

Restrict Selection of Future Dates in PowerApps Date Picker

Place the following code in the OnSelect property of the date picker. This formula will reset the date picker to the default value if the user selects a date in the future. We could easily edit this formula to display an error message. We could also use this method for restricting past dates or certain periods.

 

If (
    DatePicker1.SelectedDate > Today(),
    Reset(DatePicker1)
)