cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ivo
Frequent Visitor

Add days to a date without wekeends

Hello! Im trying to do a flow that given a date for example: 14/01/2022 (dd/mm/yyyy) and lets say 6 days, computes me the final date but without counting the weekends, if I do it with addDays it doesnt exclude me weekends, is there anyone that can give me a hand? 

Thanks!

 

1 REPLY 1
MarvinBangert
Super User
Super User

Hey @Ivo 

based on the post from Matthew (How To Add Business Days To A Date In Power Apps (Excludes Weekends) (matthewdevaney.com)) I translated this (as good as possible) to Power Automate, at least from 1-10 from 2022-01-13 it works pretty well:

 

addDays(triggerBody()['date'],add(triggerBody()['number'],mul(div(sub(add(sub(dayOfWeek(triggerBody()['date']),1),triggerBody()['number']),1),5),2)))

 

I used a "manually trigger a flow" with a date and number input. So, you would need to replace "triggerBody()['date']" and "triggerBody()['number']" with your own values.

Please also do some more tests than me, also like with February or leap year.

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (4,125)