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
sabeensp
Helper IV
Helper IV

Convert measure value into hh:mm:ss

Hello,

 

I have a meassure which is SUM(Table1[Field1]) + SUM(Table2[Field2]) Returns a single number like 7685

 

I need to convert 7685 to HH:MM:SS, how do I do that?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Hi @sabeensp 

You may try below measure.

Measure =
TIME ( 0, 0, 0 )
    + DIVIDE ( SUM ( TABLE1[Column1] ) + SUM ( TABLE2[Column2] ), ( 24 * 60 * 60 ) )

Regards,

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

View solution in original post

6 REPLIES 6
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @sabeensp 

You may create a measure like below and format it.

Measure = TIME(0,0,SUM(Table1[field1])+SUM(Table1[field2]))

 

1.png

Regards,

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

@v-cherch-msft  I tried

Production Time = TIME(0,0,SUM(TABLE1[Column1]) + SUM(TABLE2[Column2]))
Both Columns are numeric, they are in different related table, but that should not cause the problem.
I get following error:

 

Error Message:
MdxScript(Model) (15, 45) Calculation error in measure [Production Time]:

An argument of function 'TIME' has the wrong data type or the result is too large or too
small.

Hi @sabeensp 

You may try below measure.

Measure =
TIME ( 0, 0, 0 )
    + DIVIDE ( SUM ( TABLE1[Column1] ) + SUM ( TABLE2[Column2] ), ( 24 * 60 * 60 ) )

Regards,

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

It worked almost perfectly for me, except that... 🙂

I'm working with call durations in a call center, so it's basically only mm:ss. If I format hh:mm:ss, it shows 00:02:48, but if I format as mm:ss, it shows 12:48 (?!)... I'm guessing that when it is hh:mm:ss, it understand m is for minutes, but if it's formatted mm:ss, it understands m as for month... But I don't know how to solve it... Help! 🙂

RolandsP
Resolver IV
Resolver IV

Does 7685 represent seconds?

 

@RolandsP  Yes, there are seconds

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.