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
Anonymous
Not applicable

Convert decimal value of seconds into days, hours, minutes, seconds

Hi there,

 

Been searching online but it only shows how to format text and I want to show a time value if possible.

 

I have numerical values ranging from 458600 to 6 > which are the number of seconds between a start date/time and an end date/time.

I want to show this decimal as dd:hh:mm:ss or similar. 

1 ACCEPTED SOLUTION

4 REPLIES 4
hthota
Resolver III
Resolver III

Hi,

 

Create a column as given below:

 

Column= SecondsColumn/86400.

 

Later select the Column and goto Modelling and change the DataType and Format as given below.

 SecondstoTime.PNG

 

SampleSecondtoTime.PNG

Anonymous
Not applicable

@hthota thanks for this, I have tested it and at first it looked perfect but values where the time is over 24 hours e.g. 155284 seconds - is being converted to 19:08:04 when it should be 43:08:04.

Is there an IF statement I should include for higher values? 

 

🙂 

Anonymous
Not applicable

Actually @hthota  I understand why it doesn't like values over 24hrs - because i've converted it to a time, it turns 24 back into zero. This is ok, because I can filter our these values from any measures as my dataset is in QA and when we move to production we won't have call durations over a day! 

 

Thanks once again.

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.