Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
HenryJS
Post Prodigy
Post Prodigy

Cálculo del tiempo desde las horas de inicio y finalización

Hola a todos

¿Cómo puedo calcular las horas entre dos horas de inicio/finalización? La siguiente fórmula no calcula las horas de forma

Horas de activación por día ([Inicio]-[Fin])

time3.PNG

2 ACCEPTED SOLUTIONS
v-eachen-msft
Community Support
Community Support

Hola @HenryJS ,

Puede usar Time.Hour() en el editor de consultas.

if [Start]>[End] then
24-Time.Hour([Start])+Time.Hour([End])
else Time.Hour([End])-Time.Hour([Start])

Aquí está el resultado.

2-1.PNG

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

v-eachen-msft
Community Support
Community Support

Hola @HenryJS ,

¿Tiene sentido? Si tan amablemente marque mi respuesta como una solución para cerrar el caso. Gracias de antemano.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

16 REPLIES 16
v-eachen-msft
Community Support
Community Support

Hola @HenryJS ,

¿Tiene sentido? Si tan amablemente marque mi respuesta como una solución para cerrar el caso. Gracias de antemano.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
v-eachen-msft
Community Support
Community Support

Hola @HenryJS ,

Puede usar Time.Hour() en el editor de consultas.

if [Start]>[End] then
24-Time.Hour([Start])+Time.Hour([End])
else Time.Hour([End])-Time.Hour([Start])

Aquí está el resultado.

2-1.PNG

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
parry2k
Super User
Super User

@HenryJS probar esta expresión

Column = DATEDIFF ( [Column1], [Column2], HOUR)

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k desafortunadamente eso no funcionó, por favor vea a continuación

time4.PNG

@HenryJS , La fórmula de @parry2k dará el número completo. No hay tiempo

@amitchandak @parry2k ¿cómo puedo conseguir el tiempo?

@HenryJS , Eso es lo que su fórmula inicial estaba haciendo ? ¿Era una medida o columna?

@amitchandak @parry2k tengo que columnas 'Inicio' y 'Fin' ambos 'Tiempo' tipo de datos.

Necesito una nueva columna que calcule la diferencia de horas entre las horas de inicio y finalización.

¿Es posible?

@HenryJS ya te dimos una solución, por qué estás haciendo la misma pregunta. ¿Puede agregar una nueva columna basada en la expresión que publiqué.

La columna existente tiene un formato de hora porque el cálculo original era [Inicio] - [Fin] que devolvió la hora.

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k por favor vea a continuación, el número entero es incorrecto

time5.PNG

@HenryJS ¿qué supones que es el número?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 20:00pm - 05:00am debe ser una duración de 09:00 horas

@HenryJS tiene que agregar un identificador de fecha para que suceda porque la hora simple no sabe si es la misma fecha o fecha futura.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@HenryJS debe mantener el tipo de esta nueva columna para que sea un número entero, no tiempo y supongo que ese es el problema. Y como práctica recomendada, utilice siempre el nombre de tabla con las columnas de la expresión DAX, no solo el nombre de columna y las medidas, nunca use el nombre de la tabla.

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@HenryJS ¿cuál es el tipo de datos de estas columnas?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 'tiempo'

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors