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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Convert Second to x day hh:mm:ss by DAX

Hi team 
Sir @amitchandak 

I got issue here , i want to convert Second into x days hh:mm:ss 
DecToDayHHMMSS.png
pls kindly help to define dax to generate those requirement 

Thanks
SE

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Finally i found my own solution 

x Day HH:MMHSS =
var vSeconds=[TotSec]
var vMinutes=int( vSeconds/60)
var vRemainingSeconds=MOD(vSeconds, 60)
var vHours=INT(vMinutes/60)
var vRemainingMinutes=MOD(vMinutes,60)
var vDays=INT(vHours/24)
var vRemainingHours=MOD(vHours,24)
return
  vDays&" Days & "&
  vRemainingHours&" Hours & "&
  vRemainingMinutes&" Minutes & "&
  vRemainingSeconds& " Seconds"

 


Thanks Any respond
SE

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Finally i found my own solution 

x Day HH:MMHSS =
var vSeconds=[TotSec]
var vMinutes=int( vSeconds/60)
var vRemainingSeconds=MOD(vSeconds, 60)
var vHours=INT(vMinutes/60)
var vRemainingMinutes=MOD(vMinutes,60)
var vDays=INT(vHours/24)
var vRemainingHours=MOD(vHours,24)
return
  vDays&" Days & "&
  vRemainingHours&" Hours & "&
  vRemainingMinutes&" Minutes & "&
  vRemainingSeconds& " Seconds"

 


Thanks Any respond
SE

CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1642880901753.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

i required x day x hours x minutes x second in text 

Thanks 
SE

mahoneypat
Employee
Employee

Please see this article for a good way to calculate and format durations.

Calculate and Format Durations in DAX – Hoosier BI

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thanks For Insight

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.