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

Avg Journey Times Duration in hh:mm:ss

Hi All, I have a data set for duration in hh:nn:ss format in my data table. But I am not able to do avg  for each month. If i do avg i get in whole number format or genral format which i dont want.

 

What i need,

I need to get Avg duration for month in hh:nn:ss format. Below is the raw data image. Please let me know.

Show the below in Graphical Format or tabular.

June Avg= Average(june duration) 

Aug Avg= Average (august Duration )

 

Raw Data ImageRaw Data Image

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

Hi @Jeev ,

 

First create 2 columns as below:

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

Then create a measure as below:

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))

And you will see:

Annotation 2020-08-12 153555.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

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

Hi @Jeev ,

 

First create 2 columns as below:

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

Then create a measure as below:

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))

And you will see:

Annotation 2020-08-12 153555.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Greg_Deckler
Super User
Super User

@Jeev - See this Quick Measure - https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389

 

Also this article from ages ago: 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.