cancel
Showing results for
Did you mean:
Helper I

## default to today plus one in powerapps must be weekday

I have a short date field in sharepoint pulled into a power app.  I can make the default today()+1 but if it is Friday it defaults to Saturday. How to make calendar default to today plus 1 but it also must be a week day within two weeks of today.

Default date is currently DateAdd(currentday,1,Days)  but as today is Friday the next date is Saturday instead of Monday.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

You can consider the following formula:

``DateAdd(Today(), If(Weekday(Today(), Sunday)=6, 3,1), Days)``

If you need to be able to do this on other days of the weekend, then consider the following:

``DateAdd(Today(), With({_w: Weekday(Today(), Monday)}, If(_w>=5, 8-_w, 1)), Days)``

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Super User

You can consider the following formula:

``DateAdd(Today(), If(Weekday(Today(), Sunday)=6, 3,1), Days)``

If you need to be able to do this on other days of the weekend, then consider the following:

``DateAdd(Today(), With({_w: Weekday(Today(), Monday)}, If(_w>=5, 8-_w, 1)), Days)``

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Announcements

#### Launching new user group features

Learn how to create your own user groups today!

#### Community & How To Videos

Check out the new Power Platform Community Connections gallery!

#### Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,025)