Forum Discussion
Convert minutes into days and timeformat
- 9 years ago
Hi - thanks, it works. Hopefully the VAR function works quick enough also with big data!
I have modified your DAX, to display the days or not, and hour work day has only 15 hours, so I divide through 900 instead of 1440.
WE Dauer gesamt =
var Tag= INT(Lagerbeleg[WE Dauer in Min] / 900)
var Stunde= INT(MOD(Lagerbeleg[WE Dauer in Min]; 900) / 60)
var Minute= MOD(MOD(Lagerbeleg[WE Dauer in Min]; 900); 60)
var Sekunde= INT((Lagerbeleg[WE Dauer in Min] - INT(Lagerbeleg[WE Dauer in Min])) * 60)
return
IF(Tag = 0; "";
IF (Tag > 1; Tag & " Tage "; Tag & " Tag "))
& FORMAT(Stunde; "#00")
& ":"
& FORMAT(MINUTE; "#00")
&":"&
FORMAT(Sekunde; "#00")
Hello...Im Christián and I think I need something just like that...! my question is if you are able to sum that column? eg: 4 days; 8:59+2 days:3:01 geting as a result= 6days:12:00?
Hello
yes, after I calculate the sum (like above measure, or something else) - and then I used a second measure to display days and also hours.
WE Dauer (Zeit) =
IF (
[Einl Dauer Sum] > 0;
FORMAT ( INT ( [Einl Dauer Sum] / ( 1 / 24 * 15 ) ); "#00T " )
& FORMAT ( MOD ( [Einl Dauer Sum]; ( 1 / 24 * 15 ) ); "HH:MM:SS" )
)
(In this case I use 15 - because our working days are not 24h only 15h.)