web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / difference in business...
Power Apps
Answered

difference in business days between dates minus a number

(0) ShareShare
ReportReport
Posted on by 1,257 Super User 2024 Season 1

I use the following as the default in a text field  to calculate the difference between 2 dates in business days and it works well an

With(
 {
 // generate a one-column table of all dates between start date & end date
 gblDateRange: ForAll(
 Sequence(dpEnd.SelectedDate - dpStart.SelectedDate + 1),
 dpStart.SelectedDate + Value - 1
 )
 },
 If(
 And(
 IsBlank(dpStart.SelectedDate),
 IsBlank(dpEnd.SelectedDate)
 ),
 // show nothing if any date pickers are blank
 0,
 // include only dates Monday to Friday
 
 CountIf(
 gblDateRange,
 Weekday(Value) in [
 2,
 3,
 4,
 5,
 6
 ]
 )
 )
)

 

I now need to take .5 off the figure if the following localVariable is true

 

conHalf

 

Is this possible?

Categories:
  • Verified answer
    vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at
     If(
     conHalf,
     CountIf(
     gblDateRange,
     Weekday(Value) in [2, 3, 4, 5, 6]
     ) - 1,
     CountIf(
     gblDateRange,
     Weekday(Value) in [2, 3, 4, 5, 6]
     )
     )
     )
    )

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard