Forum Discussion
Calculating duration between two timestamps with millisecounds
- 1 year ago
Hi hish ,
can you try with below updated dax and let us know if you need anything else i think it will solve your issue
TimeDifferenceFormatted =
VAR CurrentTime = 'Machine Status Loops'[Zeitstempel]
VAR CurrentMachine = 'Machine Status Loops'[Maschine]
VAR NextTime =
CALCULATE (
MIN('Machine Status Loops'[Zeitstempel]),
FILTER (
'Machine Status Loops',
'Machine Status Loops'[Maschine] = CurrentMachine &&
'Machine Status Loops'[Zeitstempel] > CurrentTime
)
)
VAR Duration = NextTime - CurrentTime
VAR TotalMs = Duration * 86400000
VAR Seconds = INT(TotalMs / 1000)
VAR MilliSeconds = MOD(TotalMs, 1000)
RETURN
IF (
ISBLANK(NextTime),
BLANK(),
FORMAT(Seconds, "00") & "." & FORMAT(MilliSeconds, "000") & " sec"
)Regards,
Chaithanya.
Hi @hish ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithanya