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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
scottm0690
Frequent Visitor

Converting Seconds into Days, Hours, Min

I found a Dax formula for converting seconds into Hours, Min, seconds but want to also include days.   Not sure how to manipulate the formula for that.  Could use some help.  Here is what I have, please help.  Thanks

 

Time Left = VAR hours =
ROUNDDOWN ( [Actual time left] / 3600, 0 )
VAR minutes =
ROUNDDOWN ( MOD ( [Actual time left], 3600 ) / 60, 0 )
VAR seconds =
INT ( MOD ( [Actual time left], 60 ) )
VAR milliseconds =
round(MOD ( [Actual time left], 1 ) * 100,0)
RETURN
FORMAT(hours,"00") & ":"
& FORMAT(minutes, "00")
& ":"
& FORMAT(seconds, "00")
& "."
& FORMAT(milliseconds, "00")
1 REPLY 1
amitchandak
Super User
Super User

@scottm0690 , Add days too in calculations

 

Time Left =
VAR Days =
ROUNDDOWN ( [Actual time left] / 3600*24, 0 )
VAR hours =
ROUNDDOWN ( MOD([Actual time left],3600*24 )/ 3600, 0 )
VAR minutes =
ROUNDDOWN ( MOD ( [Actual time left], 3600 ) / 60, 0 )
VAR seconds =
INT ( MOD ( [Actual time left], 60 ) )
VAR milliseconds =
round(MOD ( [Actual time left], 1 ) * 100,0)
RETURN
FORMAT(Days,"000") & ":"
FORMAT(hours,"00") & ":"
& FORMAT(minutes, "00")
& ":"
& FORMAT(seconds, "00")
& "."
& FORMAT(milliseconds, "00")

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors