Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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_id | Empleado | company_name | timeStart | timeEnd | Horas registradas |
82220 | 55465 | Empresa ABX | 7/5/2022 12:00 | 7/5/2022 20:00 | 8.0 |
82220 | 55465 | Empresa ABX | 7/5/2022 14:00 | 7/5/2022 19:00 | 5.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
@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_id | Empleado | company_name | timeStart | timeEnd | Adj_End_Time | Horas registradas | Adj_Hours_log |
82220 | 55465 | Empresa ABX | 7/5/2022 12:00 | 7/5/2022 20:00 | 7/5/2022 14:00 | 8.0 | 2.0 |
82220 | 55465 | Empresa ABX | 7/5/2022 14:00 | 7/5/2022 19:00 | 7/5/2022 19:00 | 5.0 | 5.0 |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.