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