cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

## Control de tiempos en estaciones de trabajo

Hola!
Necesito realizar un informe sobre la productiviad unas estaciones de trabajo.

Mi problema es que hay dias que las estaciones arrancan un dia y terminan el otro, necesito encontar la forma de que no me sume el tiempo que esta fuera del horario laboral (horario laboral 7:30 am a 4:00pm), y a su vez que no me considere la media hora del almuerzo (11:30am a 12:00)

1 ACCEPTED SOLUTION
Community Support

Hi @Aguspeisino ,

I create a table as you mentioned.

Then I create a calculated table.

``````Column =
VAR StartOfWork =
TIME ( 7, 30, 0 )
VAR EndOfWork =
TIME ( 16, 0, 0 )
VAR StartOfLunch =
TIME ( 11, 30, 0 )
VAR EndOfLunch =
TIME ( 12, 0, 0 )
VAR WorkDuration =
DATEDIFF ( StartOfWork, EndOfWork, MINUTE )
VAR LunchDuration =
DATEDIFF ( StartOfLunch, EndOfLunch, MINUTE )
VAR ActualStart =
MAX ( StartOfWork, [StartTime] )
VAR ActualEnd =
MIN ( EndOfWork, [EndTime] )
VAR TotalMinutes =
DATEDIFF ( ActualStart, ActualEnd, MINUTE )
VAR ProductiveMinutes = TotalMinutes - LunchDuration
RETURN
IF ( TotalMinutes > 0, ProductiveMinutes / 60, 0 )``````

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support

Hi @Aguspeisino ,

I create a table as you mentioned.

Then I create a calculated table.

``````Column =
VAR StartOfWork =
TIME ( 7, 30, 0 )
VAR EndOfWork =
TIME ( 16, 0, 0 )
VAR StartOfLunch =
TIME ( 11, 30, 0 )
VAR EndOfLunch =
TIME ( 12, 0, 0 )
VAR WorkDuration =
DATEDIFF ( StartOfWork, EndOfWork, MINUTE )
VAR LunchDuration =
DATEDIFF ( StartOfLunch, EndOfLunch, MINUTE )
VAR ActualStart =
MAX ( StartOfWork, [StartTime] )
VAR ActualEnd =
MIN ( EndOfWork, [EndTime] )
VAR TotalMinutes =
DATEDIFF ( ActualStart, ActualEnd, MINUTE )
VAR ProductiveMinutes = TotalMinutes - LunchDuration
RETURN
IF ( TotalMinutes > 0, ProductiveMinutes / 60, 0 )``````

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.