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
Chris03_
Frequent Visitor

Diferencia de horas y desviacion de hora llegada y planeada

Buenas, tengo esta formula que me funciona para determinar la diferencia de tiemp entre una hora programada y la hora que realmente llego. 

Esta es: TimeDiff = CONVERTIR(SELECTEDVALUE(Tabla[Fecha1],0)-SELECTEDVALUE(Tabla[Fecha2],0),DATETIME).

Ahora, lo que quiero hacer es que aquellos que llegaron despues de la hora programada me de un valor o algo que diferencie que llego despues de lo programado, ya que con la formula mencionada anterior me da la diferencia sin importar eso.

1 ACCEPTED SOLUTION
v-zhouwen-msft
Community Support
Community Support

Hi @Chris03_ ,

The Table data is shown below:

vzhouwenmsft_0-1710479480213.png

‘Date1’: Scheduled time
‘Date2’: Actual arrival time

Please follow these steps:
1. Use the following DAX expression to create a measure

Measure = 
VAR _a = DATEDIFF(SELECTEDVALUE('Table'[Date1],0),SELECTEDVALUE('Table'[Date2],0),MINUTE) 
RETURN
IF(_a>0,"Failure to arrive at scheduled time","Arrived at the scheduled time")

2. Final output

vzhouwenmsft_1-1710479550434.png

vzhouwenmsft_2-1710479559780.png

 

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-zhouwen-msft
Community Support
Community Support

Hi @Chris03_ ,

The Table data is shown below:

vzhouwenmsft_0-1710479480213.png

‘Date1’: Scheduled time
‘Date2’: Actual arrival time

Please follow these steps:
1. Use the following DAX expression to create a measure

Measure = 
VAR _a = DATEDIFF(SELECTEDVALUE('Table'[Date1],0),SELECTEDVALUE('Table'[Date2],0),MINUTE) 
RETURN
IF(_a>0,"Failure to arrive at scheduled time","Arrived at the scheduled time")

2. Final output

vzhouwenmsft_1-1710479550434.png

vzhouwenmsft_2-1710479559780.png

 

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.