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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Cálculo de horas registradas pero excluyendo el tiempo superpuesto

Hola Comunidad -

Necesito ayuda sobre cómo calcular el total de horas registradas, pero excluyendo las marcas de tiempo que se superponen por empleado. Aquí hay una muestra de los datos:

ticket_idEmpleadocompany_nametimeStarttimeEndHoras registradas
8222055465Empresa ABX7/5/2022 12:007/5/2022 20:008.0
8222055465Empresa ABX7/5/2022 14:007/5/2022 19:005.0

Cuando solo sumo las horas aquí obtengo 13 horas, pero el resultado real que me gustaría ver es de 8 horas, porque todo el registro de 5 tiempos de la segunda fila se superpone al primer registro.

¿Hay alguna medida de DAX que pueda hacer esto para que no incluya ninguna de las marcas de tiempo superpuestas en mi cálculo de horas registradas? Tenga en cuenta que estas no solo son superposiciones perfectas de horas redondas, sino también minutos y segundos.

Cualquier ayuda sería muy apreciada ya que este es un asunto sensible al tiempo.

¡Gracias Comunidad!

Ryan

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@ryan_b_fiting , Cree una nueva columna y utilícela


var _next = minx(filter(Table, [Employee] = earlier([Employee]) && [ticket_id] = earlier([ticket_id]) && [timeStart] > earlier([timeStart]) ),[timeStart])
devolución
if(_next < [timeEnd], _next , [timeEnd])

Gracias @amitchandak por la rápida respuesta. Desafortunadamente ese cálculo no funciona. Para ese conjunto de datos de muestra, el resultado es de solo 7 horas.

ticket_idEmpleadocompany_nametimeStarttimeEndAdj_End_TimeHoras registradasAdj_Hours_log
8222055465Empresa ABX7/5/2022 12:007/5/2022 20:007/5/2022 14:008.02.0
8222055465Empresa ABX7/5/2022 14:007/5/2022 19:007/5/2022 19:005.05.0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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