Jun 27 2023 04:43 AM
Hello! I have created a clock in system for power apps using SharePoint as a data source and I want to be able to add up the total hrs worked for the day as well as for the week. The issue I have is creating a formula to calculate the hours on SharePoint because we made the date and time auto populate when employees clock in and allowed employees to choose which action they were taking (Punch In/Punch Out) Is there a formula where I can use to add the hours using the inputs and date and time columns?
Jun 27 2023 05:38 AM
Solution@Broly123 you can't do it that way because a calculated column can only look at the columns in the same item, not across different items. It would be best to have the Punch In and Punch Out columns in the same item. As you've mentioned Power Apps, you could do the calculation in Power Apps then patch the hours to an item in the SharePoint list.
Rob
Los Gallardos
Jun 29 2023 10:08 AM
@Rob_Elliott Thanks for the reply! I went ahead and changed it. I seem to have a problem with my formula for total worked hours that day with a 30 min lunch break. And how would I calculate for total hrs that week?
Jun 29 2023 10:51 AM
@Broly123 your endtime is empty which is why you have the problem.To calculate the hours for the week you'd either need columns for each day of the week (because a calcaulated column can only look at the same item, not across different items) or you'd need a flow in Power Automate.
Jun 29 2023 11:05 AM
@Rob_Elliott Noted. I'm still getting a negative value. Is that the correct formula I'm using? and is there a tutorial on using Power Automate to calculate the hrs for the week?
Jun 27 2023 05:38 AM
Solution@Broly123 you can't do it that way because a calculated column can only look at the columns in the same item, not across different items. It would be best to have the Punch In and Punch Out columns in the same item. As you've mentioned Power Apps, you could do the calculation in Power Apps then patch the hours to an item in the SharePoint list.
Rob
Los Gallardos