Forum Discussion
mifrasmm
Helper I
9 years agoCalculate Time to Current Time ( DAX )
Hi I need to create DAX measurement to calculate the timing ( Timer) from Issued time to current time.
- 9 years ago
Hi mifrasmm
The DATEDIFF function will return a number based on the difference between two times in your interval of choice. In the below example it returns the number of Seconds, but you can chose MINUTES, HOURS, DAYS etc.
NOW() returns the current time to the second.
Seconds = DATEDIFF([Column1],NOW(),SECOND)
tringuyenminh92
Memorable Member
9 years agoHi mifrasmm,
You could try with DATEDIFF method with interval is second. after that convert to format you want: hh:mm:ss by topic
Create calculated column:
Duration in second = DATEDIFF(Sheet1[ISSUED_DATE],NOW(),SECOND)
Format your timing:
Timer = RIGHT ( "0" & INT (Sheet1[Duration in second] / 3600 ), 2 )
& ":"
& RIGHT (
"0"
& INT ( (Sheet1[Duration in second] - INT (Sheet1[Duration in second]/ 3600 ) * 3600 ) / 60 ),
2
)
& ":"
& RIGHT ( "0" & MOD (Sheet1[Duration in second], 3600 ), 2 )