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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Obtenga el tiempo de trabajo total desde la hora de inicio y finalización en filas

Hola

Tengo un conjunto de datos de la siguiente manera:

NombreCódigo de empleadosTimestampCantidad del artículo
activity1_startemp110:0024
activity2_startemp210:1520
activity1_endemp110:1224
activity2_endemp211:0020
activity3_startemp112:0010
activity3_endemp113:1510

Lo que estoy tratando de hacer es calcular el tiempo de trabajo real de cada empleado (12 + 75 minutos para emp1; 45 minutos para emp2 en este caso), a continuación, el artículo / minuto para cada empleado.

Gracias de antemano por su ayuda.

4 REPLIES 4
amitchandak
Super User
Super User

@chillout20 , busque la solución adjunta después de la firma

Anonymous
Not applicable

Hola @amitchandak, gracias por la pronta respuesta.

Cuando abro el archivo, recibí el error "Referencia de objeto no establecida en una instancia de un objeto".

¿Puedes ver eso otra vez? ¡Gracias!

@chillout20 , Por favor, la nueva columna que creé

Column = if( right(([Name]),3) = "end" ,datediff( Maxx(FILTER(Sheet1,[Employee Code]=EARLIER(Sheet1[Employee Code]) && [Timestamp] <EARLIER([Timestamp]) && right(([Name]),5) = "start" ),[Timestamp]),[Timestamp],MINUTE),BLANK())

Por favor, vea/me gusta/comparte mi seminario web sobre Time Intelligence: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...
Mis consejos de Youtube en: https://www.youtube.com/playlist?list=PLPaNVDMhUXGYrm5rm6ME6rjzKGSvT9Jmy
Aprecia tus Felicitaciones.

Anonymous
Not applicable

Muchas gracias por su ayuda @amitchandak

Pude escribir otra fórmula basada en tu idea, sin tener que usar EARLIER:

Tiempo dedicado a la tarea ?
var CurrentEmployee á Sheet[Empleado]
var CurrentTimestamp á Sheet[Timestamp]
devolución
if( right(([Name]),3) á "end", datediff( Maxx(FILTER(Sheet, Sheet[Employee] ? CurrentEmployee && Sheet[Timestamp] <- CurrentTimestamp && right([Name]),5) á "start" ), Sheet[Timestamp]), Sheet[Timestamp]),Sheet[Timestamp],MINUTE),BLANK())

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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