Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Kudoed Authors