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 / Calculate working days...
Power Apps
Unanswered

Calculate working days from todays date from a variable in hours

(0) ShareShare
ReportReport
Posted on by

I need a label or textbox to display

from a calculation so many days from todays date based on a hour value("dwn_Tasks.Selected.ServiceLevel_hours") in a dropdown

Excluding weekends

(8 hour working day)

So if the value from the dropdown is 72 hours(4 days)from todays date ;

the date displayed would be   2020-7-13  yyyy-m-d

 

Thanks

Dave

Categories:
I have the same question (0)
  • JayMagness Profile Picture
    1,663 on at

    HI,

     

    Here is the weekdays document for PowerApps..

     

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-datetime-parts

     

    here is the document on SharePoint Formulas...

    http://blog.pentalogic.net/2008/11/working-days-weekdays-holidays-sharepoint-calculated-columns/

     

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

    Hi @Anonymous ,

     

    I feel confused with your requirement:

    Why do 72 hours mean 4 days? Is it a mistake

    What is the start day of the week? Sunday, isn't it?


    If my assumption is right, Please try to set the Text property of label as follows,

    Text(
     DateAdd(
     Now(),
     dwn_Tasks.Selected.ServiceLevel_hours/24 + 2 * If(
     (Weekday(
     Now(),
     StartOfWeek.Sunday
     ) + dwn_Tasks.Selected.ServiceLevel_hours/24) > 5,
     RoundDown(
     (dwn_Tasks.Selected.ServiceLevel_hours/24 - (5-Weekday(
     Now(),
     StartOfWeek.Sunday
     ))) / 5,
     0
     ) + 1
     )
     ),
     "[$-en-US]yyyy-m-d"
    )

    Snipaste_2020-07-08_15-23-19.png

    Hope this helps.

    Sik

     

     

  • Community Power Platform Member Profile Picture
    on at

    @v-siky-msft,

    Sunday may be the first day of the week, but is not considered a workday. Nor Saturday.

     

    But thanks will test the formula.

     

    Dave

  • Community Power Platform Member Profile Picture
    on at

    Great! and thanks. I can work with this.

    dave

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard