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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Formato de hora a partir de texto

Ahora tengo que restar el total de horas menos el AHT formateado. He convertido la columna AHT formateada en formato TIME hh:mm: ss, pero la columna Total de horas recibe un error. Además, convertí el total de horas a otro de 169h 11m 52s y utilicé un dax similar formateado AHT llamado TotalTH


Por ejemplo, el total de horas es 169:11:52, que debería ser menos 1:01:55, lo que debería dar una salida alrededor de 168:09:57 aprox., pero debido a un problema de formato, no puedo obtener el resultado. Revise el archivo para obtener más información: https://drive.google.com/file/d/1ElZARpqQlKEdepanHtZxQXeEw1H7iw8w/view?usp=drivesdk



@Ritaf1983 @amitchandak @parry2k @vicky_ @Fowmy

1 ACCEPTED SOLUTION

Esto ahora se resuelve por debajo de 2 dax


THF = VAR h= ([DATE_CLOSED_UTC_SR]-[DATE_ENTERED_SR_EST])*24 var hr= ROUNDDOWN(h,0) var m = (h-hr)*60 var mn = ROUNDDOWN(m,0) var s= rounddown((m-mn)*60,0) return format(hr,"00:") & format(mn,"00:") & format (s,"00")

Diff = var t = SUBSTITUTE(SUBSTITUTE(SUBSTITUTE([AHT Text],"h","|"),"m","|"),"s","")

var d = if(PATHLENGTH(t)=3,DIVIDE(value(pathitem(t,1)),24)+DIVIDE(value(pathitem(t,2)),24*60)+DIVIDE(value(pathitem(t,3)),24*60*60),DIVIDE(value(pathitem(t,1)),24*60)+DIVIDE(value(pathitem(t,2)),24*60*60))

VAR h= ([DATE_CLOSED_UTC_SR]-[DATE_ENTERED_SR_EST]-d)*24

var hr= ROUNDDOWN(h,0)

var m = (h-hr)*60

var mn = REDONDEO(m,0)

var s= redondeo((m-mn)*60,0)

return format(hr,"00:") & format(mn,"00:") & format (s,"00")

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Función de tiempo

hora

Un número del 0 al 23 que representa la hora.

Cualquier valor mayor que 23 se dividirá por 24 y el resto se tratará como el valor de la hora.

@saud968

Esto ahora se resuelve por debajo de 2 dax


THF = VAR h= ([DATE_CLOSED_UTC_SR]-[DATE_ENTERED_SR_EST])*24 var hr= ROUNDDOWN(h,0) var m = (h-hr)*60 var mn = ROUNDDOWN(m,0) var s= rounddown((m-mn)*60,0) return format(hr,"00:") & format(mn,"00:") & format (s,"00")

Diff = var t = SUBSTITUTE(SUBSTITUTE(SUBSTITUTE([AHT Text],"h","|"),"m","|"),"s","")

var d = if(PATHLENGTH(t)=3,DIVIDE(value(pathitem(t,1)),24)+DIVIDE(value(pathitem(t,2)),24*60)+DIVIDE(value(pathitem(t,3)),24*60*60),DIVIDE(value(pathitem(t,1)),24*60)+DIVIDE(value(pathitem(t,2)),24*60*60))

VAR h= ([DATE_CLOSED_UTC_SR]-[DATE_ENTERED_SR_EST]-d)*24

var hr= ROUNDDOWN(h,0)

var m = (h-hr)*60

var mn = REDONDEO(m,0)

var s= redondeo((m-mn)*60,0)

return format(hr,"00:") & format(mn,"00:") & format (s,"00")

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.