Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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)
Solved! Go to Solution.
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.
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.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
15 | |
10 | |
9 | |
8 | |
7 |