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

Promedio de tiempos de viaje Duración en hh:mm:ss

Hola a todos, tengo un conjunto de datos para la duración en formato hh:nn:ss en mi tabla de datos. Pero no puedo hacer promedio para cada mes. Si hago avg me me pongo en formato de número entero o formato genral que no quiero.

Lo que necesito,

Necesito obtener La duración media del mes en formato hh:nn:ss. A continuación se muestra la imagen de datos sin procesar. Por favor, avísame.

Muestre lo siguiente en Formato gráfico o tabular.

Junio Promedio medio (duración de junio)

Promedio de agosto (august Duration )

Raw Data ImageImagen de datos sin procesar

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

Hola @Jeev ,

Primero cree 2 columnas como se muestra a continuación:

Minutes = 
var _minute=MINUTE('Table'[JT Avg])
var _sec=SECOND('Table'[JT Avg])
Return
_minute+_sec/60

A continuación, cree una medida como se indica a continuación:

Measure 2 = 
var _avermin=AVERAGEX(FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])),'Table'[Minutes])
var _aversec=ROUND(_avermin-ROUNDDOWN(_avermin,0),2)*100
Return
"00:"&CONCATENATE(CONCATENATE(ROUNDDOWN(_avermin,0),":"),ROUND(_aversec,0))

Y verás:

Annotation 2020-08-12 153555.png

Para el archivo .pbix relacionado, pls ver adjunto.

Saludos
Kelly
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hola @Jeev ,

Primero cree 2 columnas como se muestra a continuación:

Minutes = 
var _minute=MINUTE('Table'[JT Avg])
var _sec=SECOND('Table'[JT Avg])
Return
_minute+_sec/60

A continuación, cree una medida como se indica a continuación:

Measure 2 = 
var _avermin=AVERAGEX(FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])),'Table'[Minutes])
var _aversec=ROUND(_avermin-ROUNDDOWN(_avermin,0),2)*100
Return
"00:"&CONCATENATE(CONCATENATE(ROUNDDOWN(_avermin,0),":"),ROUND(_aversec,0))

Y verás:

Annotation 2020-08-12 153555.png

Para el archivo .pbix relacionado, pls ver adjunto.

Saludos
Kelly
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!
Greg_Deckler
Super User
Super User

@Jeev - Ver esta medida rápida - https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389

También este artículo de hace años: https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486


@ 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...

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.