cancel
Showing results for
Did you mean:
Level: Powered On

Calculo de hora

Boa tarde,

Em uma lista do sharepoint, tenho 4 campos de dataHora e gostaria de calcular a hora total trabalhada do dia e mensal.

O objetivo é ter um cálculo no final do mes para mensurar hora extra.

1 ACCEPTED SOLUTION

Accepted Solutions
Level 10

Re: Calculo de hora

Then, calculate all durations in minutes like this:

`DateDiff(Input, Lunch, Minutes) + DateDiff(Return, Output, Minutes)`
9 REPLIES 9
Level 10

Re: Calculo de hora

Could you try writing in English ? You'll have a better chance to get a quick answer to your questions.

After translating it on the web, and if I understand well: you have 4 DateTime fields in a SharePoint list.

You want to do some calculations with these fields. But I don't understand exactly what you wan to calculate. Could you give the name of your fields and what are the durations you want to calculate ?

Emmanuel

Power Apps Staff

Re: Calculo de hora

[Rough translation of the original question: I have a SharePoint list, with 4 date/hour fields and I would like to calculate the total number of hours worked on a daily and monthly basis. The goal is to have a result at the end of the month to measure overtime]

If you have two date/time fields from SharePoint, you can subtract them directly in PowerApps, and you will get the difference in days; to get the difference in hours, multiply the result by 24.

For example, in my SP list I have four fields called DT1, DT2, DT3 and DT4 (start morning shift, end morning shift, start afternoon shift, end afternoon shift). To calculate the number of hours for a given day, I can use this expression:

```Sum(
Filter(
deleteme20190926;
DT1 >= DatePicker1.SelectedDate;
DT1 <= DatePicker1.SelectedDate + 1;
DT2 >= DatePicker1.SelectedDate;
DT2 <= DatePicker1.SelectedDate + 1;
DT3 >= DatePicker1.SelectedDate;
DT3 <= DatePicker1.SelectedDate + 1;
DT4 >= DatePicker1.SelectedDate;
DT4 <= DatePicker1.SelectedDate + 1);
24 * ((DT2 - DT1) + (DT4 - DT3)))```

Where DatePicker1 is a date picker control that has the date that we want to calculate.

Hope this helps!

Level 10

Re: Calculo de hora

You could also use the DateDiff function...

Level: Powered On

Re: Calculo de hora

Good Morning,
I have four fields (input, lunch, return, output) in date / time formats. I would like to calculate how much the employee worked per day and month in order to measure how much each employee has bank overtime or overtime.

Level: Powered On

Bom dia,

Level 10

Re: Calculo de hora

You can calculate how much hours the employee has worked during the day with this formula:

`DateDiff(Input, Lunch, Hours) + DateDiff(Return, Output, Hours)`
Level: Powered On

Re: Calculo de hora

Oi @R3dKap,

Com a formula que passou esta retornado um valor errado. Estou anexando a imagem.

Level: Powered On

Re: Calculo de hora

Boa tarde,

Com a formula ele calculou a hora mas preciso também que leve em conta os minutos. Tentei colocar na mesma formula mas deu erro.

Level 10

Re: Calculo de hora

Then, calculate all durations in minutes like this:

`DateDiff(Input, Lunch, Minutes) + DateDiff(Return, Output, Minutes)`

Announcements

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,999)