Skip to main content
cancel
Showing results for 
Search instead 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

Reply
Aguspeisino
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
v-yilong-msft
Community Support
Community Support

Hi @Aguspeisino ,

I create a table as you mentioned.

vyilongmsft_0-1717041437264.png

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 )

vyilongmsft_1-1717041603835.png

 

 

 

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.

View solution in original post

1 REPLY 1
v-yilong-msft
Community Support
Community Support

Hi @Aguspeisino ,

I create a table as you mentioned.

vyilongmsft_0-1717041437264.png

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 )

vyilongmsft_1-1717041603835.png

 

 

 

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.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors