cancel
Showing results for
Did you mean:
Regular Visitor

## Re: Convert minutes into days and timeformat

Hi Jorg @JWE,

Sorry, I do not understand the below mentioned DAX. Can you please send me in plain English (US English)?

WE Dauer gesamt =
var Tag=  INT(   Lagerbeleg[Hilfsmeasure WE Dauer in Min] / 900)
var Stunde=  INT(MOD(  Lagerbeleg[Hilfsmeasure WE Dauer in Min] ; 900) / 60)
var Minuten= INT(MOD(MOD( Lagerbeleg[Hilfsmeasure WE Dauer in Min] ; 900); 60))
var Sekunde= INT((   Lagerbeleg[Hilfsmeasure WE Dauer in Min]
- INT(   Lagerbeleg[Hilfsmeasure WE Dauer in Min] )) * 60)
return
IF(Tag = 0; "";
IF (Tag > 1; Tag & " Tage "; Tag & " Tag "))
& FORMAT(Stunde; "#00")
& ":"
& FORMAT(Minuten; "#00")

inside this I used:

Hilfsmeasure WE Dauer in Min =
SUMX(FILTER(
Lagerbeleg;
Lagerbeleg[Startdatum] = Lagerbeleg[Endedatum]
&& Lagerbeleg[Endezeit] = Lagerbeleg[MaxEndeZeit]
&& Lagerbeleg[LagerPosNr] = 1);
Lagerbeleg[Yakar Dauer Min gesamt])
+ (SUM(Lagerbeleg[Hilfsspalte WE > 1 T Sum]))
&":"&
FORMAT(Sekunde; "#00")

I'm also thinking, can we convert the below DAX to SQL?

Time_Format =

var dayNo=INT([time]/1440)
var hourNo=INT(MOD([time],1440)/60)
var minuteNO=MOD(MOD([time],1440),60)
var secondNo=INT(([lingertime]-INT([time]))*60)
return
dayNo&" day "&FORMAT(hourNo,"#00")&":"&FORMAT(minuteNO,"#00")&":"&FORMAT(secondNo,"#00")

Thanks,

Akhil.