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

Calculo de numero de dias en Power BI

Tengo la siguiente consulta para ustedes. la data tiene una fcha denominada Arrival y otra Departue bajo el formato "6/5/2019 11:54:46 AM" y una ultima denominda "Time" en el formato 00:00:05 que basicamente es la diferencia en tiempo entre Arrival y Departure.

ejemplo

        Arrival                                Departure              Time           Resultado

13/06/2019 16:50:16      17/06/2019 07:01:10      86:10:54              3              formula =day(@[Time]).

19/06/2019 14:27:47      24/06/2019 07:01:09     112:33:22             4              formula =day(@[Time]).

 

el challenge es poder calcular esta operacion en power bi, que al calcular la columna  Time me devuelva el numero de dias, ya que la formula day() en power bi no devuelve el mismo resultado que en el excel.

 

en espera de sus comentarios

 

 

Julian

 

 

1 ACCEPTED SOLUTION

Hi @Julianvesga ,

 

INT function should help you.

 

Column = INT(DATEDIFF('Table (2)'[Arrival],'Table (2)'[Departure ],HOUR)/24)

Capture.PNG

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

5 REPLIES 5
Julianvesga
Frequent Visitor

El challenge es calcularlo desde la columna Time la cual es el tiempo en horas entre la legada y salida, y que me devuelva el numero de dias. en excel solo es usar la funcion (=Day), pero en power bi no devuelve el mismo resultado.

v-frfei-msft
Community Support
Community Support

Hi @Julianvesga ,

 

Try this formula.

 

Resultado = datediff ([Arrival],[Departure]),DAY)
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Una consulta por favor, ya le di mil vueltas y no lo he logrado hacer ... 

En el ejemplo de la consulta inicial, como haria si quiero que me salga en el fomato de HH:MM:SS, es decir  la respuesta sería 86:10:54

     13/06/2019 16:50:16 17/06/2019 07:01:10             86:10:54

Muchas gracias.

Hi, doesn't work.

Hi @Julianvesga ,

 

INT function should help you.

 

Column = INT(DATEDIFF('Table (2)'[Arrival],'Table (2)'[Departure ],HOUR)/24)

Capture.PNG

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others 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.

Top Solution Authors
Top Kudoed Authors