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
kenblack
Helper I
Helper I

calcular la duración

Tengo dos columnas en el siguiente formato

04/06/2020 05:02:00 así dd/mm/aaaa hh/mm/ss y me gustaría restar uno del otro para obtener la duración en hrs - ¿puede alguien ayudar por favor

Gracias de antemano

5 REPLIES 5
Greg_Deckler
Super User
Super User

@kenblack - Si necesita la duración neta del trabajo, puede utilizar esto: https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Duration-Working-Hours/m-p/481543#M...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@kenblack ,

[Fecha1]-[fecha2] dará a Duarion

datediff([Date1],[Date2], hour) dará diff en horas

DataZoe
Employee
Employee

@kenblack También puede hacerlo en DAX con la función DATEDIFF https://docs.microsoft.com/en-us/dax/datediff-function-dax

Diferencia de horas: DATEDIFF([Inicio],[Fin],HORA)

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Sí, si necesita esto en una medida, DATEDIFF() funcionará bien. Si necesita una columna, Power Query suele ser una mejor opción para el rendimiento que una columna calculada. Así que depende de cómo se está utilizando esto.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
edhans
Super User
Super User

Utilice la función Duration.TotalHours() en Power Query. Simplemente reste la columna 1 de la columna 2. Devolverá el total y las horas fraccionarias.

edhans_0-1596473705595.png

Si solo necesita horas, redondee usando Number.Round(fórmula, 0)



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.