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 Apps / FORMULA FOR CALCULATIN...
Power Apps
Unanswered

FORMULA FOR CALCULATING HALF DAY IN LEAVE REQUEST

(0) ShareShare
ReportReport
Posted on by 16

Can someone help me to amend formula to calculate half day in leave request.

 

The formula I'm currently using is below:

 

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

Categories:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    For checking half day leave request, are you having a checkbox or dropdown where user selects leave type = Half day/ Full day

  • Avinash2 Profile Picture
    16 on at

    Hello Maam,

     

    Good afternoon.

     

    Yes I do have a checkbox added. 

     

    My requirement is to deduct the total leave from total balance allocated to employee in another sharepoint List.

     

    With the formula i mentioned Above im able to get total leave days excluding holidays , now to need half day as well

     

     

  • Avinash2 Profile Picture
    16 on at

    Hello Maam,

     

    kindly see my flow and the formula I have used in another method:

     

    I have used 2 list named :

     

    Leaves : containes employee name and their balance leave.

    Leave request: for making request

    I have used calculated column "Totaldays" to calculate no of leave applied excluding weekend.

    In the below flow can you advise how can i include the formula to call sharepoint list containing holiday and to get total leave applied by excluding both weekends and Holidays ?

     

     

     

    1.png2.png3.png4.png5.png6.png7.png8.png9.pnglist-1.pngList-2.png

  • nsmarc Profile Picture
    8 on at

    Hi, Thank you for this solution. This is what I am after. Are you able to provide the full expressions for "float" and "sub"?

     

    Many thanks in advance.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard