Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Buenos Dias.
Estoy haciendo unos graficos en power Bi pero no me ha sido posible representar un promedio de un dato en formato hh:mm:ss
Solved! Go to Solution.
Cool my dear friend, Try this one
Age(HH:MM:SS) :=
VAR Duration = Measure in Seconds
VAR Hours =
ROUNDDOWN ( Duration /3600 , 0 )
VAR Minutes =
ROUNDDOWN ( ( Duration - ( Hours *3600 ) )/60, 0 )
VAR Seconds =
ROUND(MOD ( Duration - ( Hours *3600 ),60 ),0)
VAR H =
IF ( LEN ( Hours ) = 1,
CONCATENATE ( "0", Hours ),
CONCATENATE ( "", Hours )
)
VAR M =
IF (
LEN ( Minutes ) = 1,
CONCATENATE ( "0", Minutes ),
CONCATENATE ( "", Minutes )
)
VAR S =
IF (
LEN ( Seconds ) = 1,
CONCATENATE ( "0", Seconds ),
CONCATENATE ( "", Seconds )
)
RETURN
CONCATENATE (
H,
CONCATENATE ( "h : ", CONCATENATE ( M, CONCATENATE ( "m : ", CONCATENATE(S,"s") ) ) )
)
Hi @rey4125,
In my opinion, you can convert the time field to total second, calculated average of the total second, then format these data to time.
Sample:
Total Second= Hour(Table[Date])*3600 + Minute(Table[Date])*60+ Second(Table[Date]) AverageTime = var temp=INT(AVERAGE([Total Second])) var h=INT(DIVIDE(temp,3600)) var m=INT(DIVIDE(temp-h*3600,60)) var s=temp-h*3600-m*60 return TIME(h,m,s)
Regards,
Xiaoxin Sheng
Hi @rey4125,
In my opinion, you can convert the time field to total second, calculated average of the total second, then format these data to time.
Sample:
Total Second= Hour(Table[Date])*3600 + Minute(Table[Date])*60+ Second(Table[Date]) AverageTime = var temp=INT(AVERAGE([Total Second])) var h=INT(DIVIDE(temp,3600)) var m=INT(DIVIDE(temp-h*3600,60)) var s=temp-h*3600-m*60 return TIME(h,m,s)
Regards,
Xiaoxin Sheng
Cool my dear friend, Try this one
Age(HH:MM:SS) :=
VAR Duration = Measure in Seconds
VAR Hours =
ROUNDDOWN ( Duration /3600 , 0 )
VAR Minutes =
ROUNDDOWN ( ( Duration - ( Hours *3600 ) )/60, 0 )
VAR Seconds =
ROUND(MOD ( Duration - ( Hours *3600 ),60 ),0)
VAR H =
IF ( LEN ( Hours ) = 1,
CONCATENATE ( "0", Hours ),
CONCATENATE ( "", Hours )
)
VAR M =
IF (
LEN ( Minutes ) = 1,
CONCATENATE ( "0", Minutes ),
CONCATENATE ( "", Minutes )
)
VAR S =
IF (
LEN ( Seconds ) = 1,
CONCATENATE ( "0", Seconds ),
CONCATENATE ( "", Seconds )
)
RETURN
CONCATENATE (
H,
CONCATENATE ( "h : ", CONCATENATE ( M, CONCATENATE ( "m : ", CONCATENATE(S,"s") ) ) )
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |