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 / 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
    156,100 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard