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 Automate / Adding 24 hours to a d...
Power Automate
Answered

Adding 24 hours to a date but skipping weekends and holidays provided in a table

(1) ShareShare
ReportReport
Posted on by 146

Hello there, 

I was wondering if anyone has any thoughts on how I could add 24 hours to a date/time but skip over a list of holidays I have stored in a dataverse table. It could easily be an excel table or something else too. 

 

 

Categories:
I have the same question (0)
  • Verified answer
    trice602 Profile Picture
    15,404 Super User 2025 Season 2 on at

    Hi @dextoar ,

     

    You can certainly to the Dataverse table route but might be overkill unless your holidays are already there.  Because the number of holidays most likely are less than 10, you could go this route with a conditional action OR my next plan would be an excel table and I will describe that at the bottom.  Here's the conditional action option:

     

    trice602_3-1694828195880.png

     

     

    My first compose get's the day or week in this format 'ddd' such as Sat or Sun.

     

    formatDateTime(body('Current_time'),'ddd')
     
    I then check if the DOW is Sat or Sun in my condition shown below:
     
    trice602_4-1694828263310.png

     


     

    Then to show the Holiday option inside the condition action, I threw in a couple of dates so essentially if this is true, add 24 hours to my date, otherwise skip.

     

    addHours(body('Current_time'),24)
     
    The formatDatetime expressions below is: 
    formatDateTime(utcNow(),'MM-dd-yyyy')
     
    trice602_5-1694828352718.png

     


     

    Give this a try and run it a couple of times, with today as a Holiday but this is one option.

     

    The Excel option:

     

    A simple table with Date column and also is the key column.  if the body of the output is > 0 then it's not a Holiday.

     

    trice602_6-1694828978010.png

     

    length(body('Get_a_row'))
     
    That said, you have a couple of options to consider.  My preference is just the conditional action.
     
     

     

    Get row in a table

     

     

  • Verified answer
    Linn Zaw Win Profile Picture
    2,996 on at

    @dextoar 

    There is a blog post on how to add working days (just 1 for your case) excluding weekends and Public Holidays (maintained in the SharePoint list but it will work for any data source as long as it is mapped in HolidayDays Select step)

    https://www.tachytelic.net/2022/04/power-automate-flow-add-working-days-date/

     

    Here's a video tutorial

    https://www.youtube.com/watch?v=zPKEGT03AZE

     

    Other blog posts

    https://devoworx.net/how-power-automate-add-working-days-to-date-correct-solution/

    https://www.penthara.com/how-to-dynamically-calculate-working-business-days-for-a-due-date-in-power-automate/

     

     

  • Dextoaar Profile Picture
    146 on at

    Appreciate both of your thoughts here. They were helpful in how to approach. I ended up connecting to an excel,  running a workdays formula, and returning the formula into the table. 

  • trice602 Profile Picture
    15,404 Super User 2025 Season 2 on at

    Hi @dextoar ,

     

    Glad you got something that works!  If both of these posts were helpful and viable solutions, please consider marking both as a solution to help others find these options too!  

     

     

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard