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

TimeDifference con dos veces

Hola

¿Podría ayudar con el cálculo aquí?

Mi cálculo de medida está tratando de restar los tiempos 'sdate' y 'edate' y por debajo debe ser 2:10 y su visualización como 3:00 en la tarjeta.

¿Es porque he usado MAX? He creado otra columna con el cálculo funcionando y mostrando 2:10, pero no sé cómo hacer referencia a esto en la medida.

timediff.PNG

5 REPLIES 5
amitchandak
Super User
Super User

@lherbert502, la primera manera de tomar diff es que lo creas como columna

Nueva columna [Tiempo1] -[time2]


opciones de medida

medida 1 - sumx(Tabla, Tabla[Tiempo1] -Tabla[time2]) //se puede utilizar averageX


calculate( min(Table[Time1] ) -max(Table[time2]) , values(Table[ID])) // force row context, pero Gt se equivocará

referencia para el contexto de fila

https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...

Anonymous
Not applicable

Hola @amitchandak ,

¿Seguiría siendo SUMX con abajo?

IF(SUMX(RoomUtilisation, RoomUtilisation[New End Date]>[ParameterEndDate]),0,1)?

¿Sería un operador diferente?

Gracias

@lherbert502, ¿qué intentas lograr aquí?

Anonymous
Not applicable

Hola @amitchandak ,

Tengo un par de declaraciones If

IF(SUMX(RoomUtilisation, RoomUtilisation[New End Date]>[ParameterEndDate]),1,

IF(SUMX(RoomUtilisation, RoomUtilisation[New End Date]<[ParameterEndDate]),2,

IF(SUMX(RoomUtilisation, RoomUtilisation[New End Date]<- [ParameterEndDate]),3,0

Dice que SUMX no puede funcionar con el tipo Boolean. He comprobado el formato y todo es correcto.

Anonymous
Not applicable

Gracias @amitchandak como siempre 🙂

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.