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 / Use DateAdd to determi...
Power Apps
Answered

Use DateAdd to determine if day is Monday then subtract three days

(0) ShareShare
ReportReport
Posted on by 96

I have a interesting problem. I want to use a date picker and if date is a Monday then subtract three days where the resultant day would be a Friday.

I have a business scenario that calls for the date picker to -1 days, but not to fall on a weekend.

Here is my attempted formula (it has errors).

I am trying to write an IF ELSE

Pseudocode explanation: If day is Monday then subtract three days. ELSE subtract one day

 

If(Weekday(DataCardValue8.SelectedDate),2,DateAdd(DataCardValue8.SelectedDate,-3))

else DateAdd(DataCardValue8.SelectedDate,-1)

 

My attempt at using the Weekday() function was to isolate the day of the week as Monday which was designated by the 2.

Can someone look at my formula and fix both the IF ELSE statement and the logic? I'm stumped. Thanks.

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @adove ,

    Try this

    With(
     {_Date: DataCardValue8.SelectedDate},
     DateAdd(
     _Date,
     If(
     Weekday(_Date) = 2,
     -3,
     -1
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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