cancel
Showing results for
Did you mean:
Responsive Resident

Trying to find either a solution of workaround for this..

I want to add a set number of Business days to a date.    So this number varies a lot so I can't really hard code it in.   for example I choose X in a drop down then the number of days to add is 10  I choose Y the number of days to add is 12 etc.. there are a lot of variations.

The number of days is in a txt box and at the moment I just do a simple  addition formula.  but that's obviously a full 10 days or 12 days and I only want to add business days !!

Any suggestions?

TIA

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support

Hi @vffdd ,

If the first day of week is Sunday, please try this, just replace the 'TextBox.Text'

Now(),
Value(TextBox.Text) + 2 * If(
(Weekday(
Now(),
StartOfWeek.Sunday
) + Value(TextBox.Text) > 5,
RoundDown(
(Value(TextBox.Text) - (5-Weekday(
Now(),
StartOfWeek.Sunday
))) / 5,
0
) + 1
)
)

If the first day of week is Monday, please try this:

Now(),
Value(TextBox.Text) + 2 * If(
(Weekday(
Now(),
StartOfWeek.Monday
) + Value(TextBox.Text)) > 5,
RoundDown(
(Value(TextBox.Text) - (5-Weekday(
Now(),
StartOfWeek.Monday
))) / 5,
0
) + 1
)
)

Hope this helps.

Sik

3 REPLIES 3
Solution Sage

Hi @vffdd

Here's a very good article that shows how to take only in account working days, thus without weekends and holidays:

https://powerapps.microsoft.com/es-es/blog/excluding-weekends-and-holidays-in-date-differences-in-po...

Hope it helps!

Community Support

Hi @vffdd ,

If the first day of week is Sunday, please try this, just replace the 'TextBox.Text'

Now(),
Value(TextBox.Text) + 2 * If(
(Weekday(
Now(),
StartOfWeek.Sunday
) + Value(TextBox.Text) > 5,
RoundDown(
(Value(TextBox.Text) - (5-Weekday(
Now(),
StartOfWeek.Sunday
))) / 5,
0
) + 1
)
)

If the first day of week is Monday, please try this:

Now(),
Value(TextBox.Text) + 2 * If(
(Weekday(
Now(),
StartOfWeek.Monday
) + Value(TextBox.Text)) > 5,
RoundDown(
(Value(TextBox.Text) - (5-Weekday(
Now(),
StartOfWeek.Monday
))) / 5,
0
) + 1
)
)

Hope this helps.

Sik

Responsive Resident

Perfect thanks a million @v-siky-msft

Announcements

#### Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

#### Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

#### 2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

#### Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,369)