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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
stribor45
Post Prodigy
Post Prodigy

Show duration as mm:ss

This is my DAX code as a measure to show average time of the call

 

AVG TIME = 
  
    VAR X = SUM('Table'[Column])
    VAR Y = A + B
    RETURN FORMAT (DIVIDE(X, Y), "hh:mm:ss") & " min"

My result looks like this

00:14:33

which is correct result when comparing this by going into the excel and calculating average there. I would like this to be shown as 

14:33

but as soon as I adjust formating string to 

"hh:mm"

my result changes and looks incorrect. Is there a way to show this value as "14:33"

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

pls try this

AVG TIME = 
  
    VAR X = SUM('Table'[Column])
    VAR Y = A + B
    VAR _tim =FORMAT (DIVIDE(X, Y), "hh:mm:ss") & " min"
 RETURN 

MID(_tim, SEARCH(":",_tim,1,1)+1,5)

View solution in original post

1 REPLY 1
Ahmedx
Super User
Super User

pls try this

AVG TIME = 
  
    VAR X = SUM('Table'[Column])
    VAR Y = A + B
    VAR _tim =FORMAT (DIVIDE(X, Y), "hh:mm:ss") & " min"
 RETURN 

MID(_tim, SEARCH(":",_tim,1,1)+1,5)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.