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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.