Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Power Automate flow AddHours to exclude weekends.

(0) ShareShare
ReportReport
Posted on by 753

Hello everyone,

 

I want to create a flow that add 12 hours to a time that only includes Business Hours (08:00 - 17:00).

 

Example:

Monday 08:42 am add 12 hours

 

Output:

Tuesday 11:42 am

 

Example:

Friday 08:42 am add 12 hours

 

Output

Monday 11:42 am

 

Hopefully someone can help me.

  • Caleb62881177 Profile Picture
    753 on at
    Re: Power Automate flow AddHours to exclude weekends.

    @Matthy79 - Sorry, I was referring to the text below that question.

     

    Can you perhaps help me with a different topic that I created?

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Power Automate flow AddHours to exclude weekends.

    I don't understand the question "How does this approach sound for the holidays?"

     

    And for the rest of the flow. There are many ways to do it. You have to find the best way for you to build and maintain it. Everybody has a different approach of doing things. It is important that you understand the final solution so that you can do changes if there are changes on the requirement.

  • Caleb62881177 Profile Picture
    753 on at
    Re: Power Automate flow AddHours to exclude weekends.

    @Matthy79 - How does this approach sound for the holidays?

     

    Will probably need some method where you list the holiday dates and then compare the date to all of the dates in that list. Can make an array and put in dates, then have the flow go through them. Similarly,  could have like a SharePoint list of dates that include company holidays or something and go through that list.

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Power Automate flow AddHours to exclude weekends.

    This depends on the skillset in your company. Could be python, java, whatever. Hosted on premise or in cloud. And yes, you can also do this in Power Automate and maybe someone in this forum wants to build it for you.

     

    If you want to build it on your own, I would suggest to put the values of all holidays for the next 100 years hardcoded in an array instead of checking them every time you calculate a single SLA.

  • Caleb62881177 Profile Picture
    753 on at
    Re: Power Automate flow AddHours to exclude weekends.

    @Matthy79 - What would you suggest doing this with?

     

  • Caleb62881177 Profile Picture
    753 on at
    Re: Power Automate flow AddHours to exclude weekends.

    @Matthy79 - lol.

     

    I have actually created a topic for that scenario, but I haven't gotten the correct response from that topic.

    Unfortunately the solution has to be automated.

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Power Automate flow AddHours to exclude weekends.

    In my opinion that is the wrong way to do it. It is like building a house and after you finished with the roof you say: "Hey a second floor would be nice". And after someone takes away the roof, builds the second floor and adds the roof again you say: "Looks really great but a basement is required as well". Of course you can do it this way, but this will increase your costs a lot.

     

    Maybe someone else wants to take it from here or you create a new topic. (Need support with full SLA calculation)

     

    I don't recommend doing this via Power Automate.

  • Caleb62881177 Profile Picture
    753 on at
    Re: Power Automate flow AddHours to exclude weekends.

    @Matthy79 - I tried to take the solution one step at a time. How would one redesign the flow?

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Power Automate flow AddHours to exclude weekends.

    No, this is not possible the way this solution is designed. It is always best practice to think about all the edge cases you need at the beginning and write it down. Of course it would be possible to also include whatever functionality is needed in the future (maybe Friday less hours or special holidays or whatever) and redesign the flow but I don't think Power Automate is the right tool to do a complet SLA calculation.

  • Caleb62881177 Profile Picture
    753 on at
    Re: Power Automate flow AddHours to exclude weekends.

    @Matthy79  I had a look at your solution and it works. Thank you.

     

    Can you perhaps add a condition to your last solution where it exclude public holidays?

    Example:

    2023-12-25

    2024-01-01

    2024-02-21

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1