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
navedkhan
Helper III
Helper III

ALTAMENTE URGENTE - Calcular la diferencia de sello de tiempo

Hola a todos - me enfrento a dificultades en el cálculo de la diferencia de marca de tiempo en función de las condiciones. Mis datos se ven como a continuación;

Capture.JPG

Ahora quiero ver estos como abajo;

1) Filtrar filasbasadasen ' Hora y fecha más tempranas ' de un elemento de trabajo dado para que obtengamos 1 fila para 'Activo' (fecha y hora más tempranas) y 'Pendiente' (fecha y hora más tempranas)

2) a continuación, calcular la diferencia: Fecha y hora pendientes más tempranas - Fecha y hora activas más tempranas

¿Es posible hacer esto en DAX?

@amitchandak @parry2k @Zubair_Muhammad @Felix

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hola

Si la pregunta sigue sin respuesta, a continuación, compartir el enlace desde donde puedo descargar su archivo PBI.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-diye-msft
Community Support
Community Support

Hola @navedkhan

Por favor, compruebe mis resultados a continuación:

Measure = CALCULATE(MIN('Table'[Date&Time]),ALLEXCEPT('Table','Table'[Workitem no. ],'Table'[Status]))
Measure 2 = var a = MINX(FILTER(ALL('Table'),[Workitem no. ]=MAX('Table'[Workitem no. ])&&[Status]="Pending"),[Measure])
Return
ABS(DATEDIFF(a,[Measure],HOUR))

05.PNG

Pbix unido.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

@navedkhan , Probar como

if([Status] ="Pending"  ,maxx(filter(table,[workiten_no] =earlier([workiten_no])  && [Status] ="Active"),[Date & time])
minx(filter(table,[workiten_no] =earlier([workiten_no])  && [Status] ="Pending"),[Date & time]),blank())

¿podrían sugerir con una solución viable? Estoy esperando para ponerlo en producción.

No, no funciona como se esperaba. me da valores de fecha y hora incorrectos.

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.