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 / Forecast Due date and ...
Power Apps
Answered

Forecast Due date and excluding Weekends

(0) ShareShare
ReportReport
Posted on by 195

Hello,

 

I am working on an app that will forecast the due date of the task. 

 

I have a number field that calculates the number of Days required to finish the task based on complexity. Now, I want the total number of days to be added from Start Date.

 

StartDate + DaysofCompletion = Deadline.

 

My problem is that it does not exclude weekend. And note that the DaysofCompletion is atleast 20 Days (which is close to 3 weeks = 3 weekends (Sat & Sun))

 

I wanted to exclude every weekend it will pass from Startdate + DaysofCompletion. 

 

Kindly help me on this.


Thank you!

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

    Hi @anabananei ,

    Here is a good solution also excluding Public Holidays.

     

    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.

  • Verified answer
    v-siky-msft Profile Picture
    on at

    Hi @anabananei ,

     

    Please try with this:

     

    DateAdd(
     DatePicker1.SelectedDate,
     DaysofCompletion.Text + 2 * If(
     (Weekday(
     DatePicker1.SelectedDate,
     Monday
     ) + Value(DaysofCompletion.Text)) > 7,
     RoundDown(
     (DaysofCompletion.Text - (5-Weekday(
     DatePicker1.SelectedDate,
     Monday
     ))) / 5,
     0
     ) + 1
     )
    )

     

     

    This code works in both cases

    1. StartDate + DaysofCompletion is still in the same week

    2. StartDate + DaysofCompletion is not in the same week

    Snipaste_2020-06-22_14-58-47.png

    Hope this helps.

    Sik

  • anabananei Profile Picture
    195 on at

    Worked like a charm! Thank you!

  • anabananei Profile Picture
    195 on at

     

    Hi @v-siky-msft ,

     

    Just a question, if I am to have a list of holidays from my country, how should I proceed with the solution?

     

    Thanks,

    A

  • Verified answer
    WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @anabananei ,

    Please look at my post - it had this also. I did not think I had to re-paste it as it was all set out in the document for you.

     

    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.

  • anabananei Profile Picture
    195 on at

    I'll take a look. Thank you! 🙂

  • anabananei Profile Picture
    195 on at

    Hello @WarrenBelz ,

     

    Thank you for your post. Upon review, the solution has identified both start date and end date. Whereas in my current solution, the app forecast exclude the weekends/holidays before forecasting the end date. What @v-siky-msft  said works for me, however, I'm confused how to incorporate the holiday list from the formula. Any help would be appreciated.

     

    Thank you!

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 739 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 268

Last 30 days Overall leaderboard