cancel
Showing results for
Did you mean:
Resolver III

## Calc overtime per workweek

Currently in the process of creating a power app that needs to calculate the overtime earnings per work week, the challenge I am facing right now is the fact that at our organization we have a 38 hour workweek, this means that when someone puts in lets say 3 hours OT for a Saturday then the first 2 hours are charged at 100% and the remaining hours are then charged at 150%, so in this example the remaining 1 hour OT should be charged at 150%. The problem with the current formula is that when someone puts in more than 2 hours OT for a workweek then these hours are always calculated at 150%, same is true for OT hours more than 2 performed either on a Sun or a Holiday. I am looking for a way so that when for example 3 hours OT are entered for the first time in a workweek that 2 rows are charged at 100% and the remaining OT Hour is charged at 150% or 200%. So ideally, in this case, in my gallery I should see 2 rows charged at 100% and 1 row charged at 150%.  Any help is most appreciated.

//wWeek keeps a running total of OT performed within a workweek for selected employee.

With(
{
wWeek: With(
{
wList: Filter(
OREPayrollOvertime,
Week = Value(DataCardValueWeekNew.Text) && EmpID = GalleryOTResManagers.Selected.ID
)
},
Sum(
wList,
OvertimeHours
) + 38 + DataCardValueHoursOTWorked
)
},

If(
wWeek <= 40 &&
Text(DataCardValueDateOT.SelectedDate,"ddd") in ["Sun","Mon","Tue","Wed","Thu","Fri", "Sat"],
100,
wWeek > 40 &&
Text(DataCardValueDateOT.SelectedDate,"ddd") = "Sun" || LookUp(
OREHolidays,
DateHoliday = DataCardValueOTEdit.SelectedDate,
true
),
200,
150
)
)

0 REPLIES 0

Announcements

#### December 2023 User Group Update: Welcoming New Groups and Upcoming Events

A new month means it's time to celebrate and welcome the new user groups that have joined our community. We are excited to announce that we have more than 8 New Groups, which is no surprise after the amazing Microsoft Power Platform Conference. This month, we are breaking them out by the different community categories. If your group is listed here, give this post a kudo so we can celebrate with you! Don't forget to take a look at the many events happening near you or virtually! It's a great time of year to connect and engage with User Groups both locally and online.   Please Welcome Our NEW User Groups   Power Platform: PowerIT User Group: Nottingham Power Platform User Group: Bergen Power Platform User Group: Danmark Nashville Power Platform User Group Microsoft Ambassador Program y Mujer Latina Technolochicas NCWIT Community Copilot Studio:  Copilot User Group Italia Dynamics365: Dynamics User Group AdriaticDynamic 365 Azerbaijan   December User Group Events   01 Dec 2023 Aprendiendo Desarrollo web, creando mi primer power app y power page. 01 Dec 2023 Q4 Hybrid Philadelphia Dynamics 365 & Power Platform User Group Meeting05 Dec 2023APAC Dynamics 365 FastTrack Bootcamp - BI and Analytics07 Dec 2023Bay Area Power Platform Meetup: Learn, Share, and Connect07 Dec 2023Indiana D365/AX December User Group Meeting07 Dec 2023Dynamics User Group Meeting: Houston09 Dec 2023 December '23 - NEW Power Apps User Group Meeting - Online 12 Dec 2023December Cleveland Power Platform User Group Meeting12 Dec 2023 RW2 Data Stewardship Open Forum Discussion 13 Dec 2023  Black Country Power Platform User Group - December 2023 - West Midlands