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

Calculating work days from a leave request

 

Hi, 

 

I have a table in Dataverse called Work Schedules, which has 7 decimal fields (for Monday to Sunday) which allows me to log when staff have work hours on each day per week. This table also has a start date and end date field for the schedule period. Most users work 8 hours, Monday to Friday. But some do 8 hours Mon-Weds, or Thurs-Sat.

 

I also have a Dataverse table called Leave Requests, which has a lookup to the Work Schedule for the user. Here the user can submit for leave, with a 'start date' and 'end date' field. I've also added a field called 'Work Days Requested'.

 

Given that some Work Schedules are different, I am struggling to find a way of calculating how many work days are being requested from Leave Requests between the two dates. For example, if someone had a Work Schedule of Mon-Frid 8 hours per day and submitted a Leave Request for the full week it would be 5 work days. But for the same period for someone working just Mon-Wed it would be 3 work days. 

 

My thinking was to do this in Power Automate, and update the Work Days Requested field, but I'm stuck.

 

Any help would be welcome.

0 REPLIES 0

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (2,385)