Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

power app

Posted on by

hey guys can you'll kindly assist me, I'm trying to create the formular that will be set on date control default as a due date, due date is two weeks from current date. 

  • Verified answer
    timl Profile Picture
    timl 31,946 on at
    Re: power app

    Hi @swelihle - can you confirm whether the above answers your question?

  • Verified answer
    timl Profile Picture
    timl 31,946 on at
    Re: power app

    @swelihle 

    If you want to return a date that's 10 working days from today (ie, 2 weeks excluding weekends), this is the formula that you would use.

    With({ startDate:Now(),
     daysToAdd: 10
     },
     DateAdd(startDate, daysToAdd) + 
     RoundDown(daysToAdd/5, 0)*2 +
     Switch(Weekday(startDate, StartOfWeek.Monday),
     5,If(Mod(daysToAdd, 5)>0,2,0),
     4,If(Mod(daysToAdd, 5)>1,2,0),
     3,If(Mod(daysToAdd, 5)>2,2,0),
     2,If(Mod(daysToAdd, 5)>3,2,0),
     1,If(Mod(daysToAdd, 5)>4,2,0)
     )
    )

     

  • Re: power app

    how can i exclude weekends for my due date 

     

  • timl Profile Picture
    timl 31,946 on at
    Re: power app

    Hi @swelihle 

    This will give you the date that is 2 weeks from today:

    DateAdd(Now(), 14, TimeUnit.Days)

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,297

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,890

Leaderboard