Forum Discussion
Anonymous
7 years agoNot applicable
Convert the time format in custom column
Please tell me how to customize the column Time which is (HH:MM:SS) format and i want it in (MM:SS) format in power BI. What is the formula and steps to convert it ?
- 7 years ago
Hi Anonymous ,
Below two options might meet your requirement.
Column = FORMAT ( MINUTE ( TB2[Time] ), "00" ) & ":" & FORMAT ( SECOND ( TB2[Time] ), "00" ) Column 2 = VAR _totalSec = HOUR ( TB2[Time] ) * 60 * 60 + MINUTE ( TB2[Time] ) * 60 + SECOND ( TB2[Time] ) RETURN INT ( _totalSec / 60 ) & ":" & FORMAT ( _totalSec - INT ( _totalSec / 60 ) * 60, "00" )Best regards,
Yuliana Gu
v-yulgu-msft
7 years agoMicrosoft Employee
Hi Anonymous ,
Below two options might meet your requirement.
Column =
FORMAT ( MINUTE ( TB2[Time] ), "00" ) & ":"
& FORMAT ( SECOND ( TB2[Time] ), "00" )
Column 2 =
VAR _totalSec =
HOUR ( TB2[Time] ) * 60 * 60
+ MINUTE ( TB2[Time] ) * 60
+ SECOND ( TB2[Time] )
RETURN
INT ( _totalSec / 60 ) & ":"
& FORMAT ( _totalSec - INT ( _totalSec / 60 ) * 60, "00" )
Best regards,
Yuliana Gu