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!
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
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
30 | |
29 | |
28 | |
20 | |
11 |