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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Getting the average "minutes" in a column


Hey everyone, this is my first time posting in the Power BI community support and I'm just getting started with Power BI.


Can anyone help me solve this problem I have.

I have a column that has the time that a task took to complete in the format HH:MM:SS

so for example one row is this: 86:42:15 
82 Hours, 42 Minutes, 15 Seconds.

 

When I try to get the average for the column it gives me nonsense numbers and it's right I guess cuz it doesn't know what this data is. The format is in text for the moment. Can anyone help with the steps I need to achieve this task?

Thanks in advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Check the following formulas.

Column = 
var hours = MID('Table'[Column1],1,2)*60
var minutes = MID('Table'[Column1],4,2)*1
var seconds = MID('Table'[Column1],7,2)/60
var sum_ = hours+minutes+seconds
return
sum_

Column 2 = AVERAGE('Table'[Column])

11.PNG

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

Check the following formulas.

Column = 
var hours = MID('Table'[Column1],1,2)*60
var minutes = MID('Table'[Column1],4,2)*1
var seconds = MID('Table'[Column1],7,2)/60
var sum_ = hours+minutes+seconds
return
sum_

Column 2 = AVERAGE('Table'[Column])

11.PNG

 

Best Regards,

Jay

mahoneypat
Microsoft Employee
Microsoft Employee

Not straight forward, but you can put this formula in a custom column to get the total hours in decimal form that you can use for calculations.

 

= let

hours = Number.FromText(Text.BeforeDelimiter([TimeColumn], ":",0)),
minutes = Number.FromText(Text.BetweenDelimiters([TimeColumn], ":",":")),
seconds = Number.FromText(Text.AfterDelimiter([TimeColumn], ":",1))
in
Duration.TotalHours(#duration(Number.RoundDown(hours/24,0), Number.Mod(hours, 24), minutes, seconds))

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


AlB
Community Champion
Community Champion

Hi @Anonymous 

What data type is the column, text?

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors