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

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.

Reply
matheuskei
New Member

how to conver or format minutes with dax or something else ?

matheuskei_0-1676056032205.png

 

i need put the minutes (tempo suprimido) like 00:02 or 0:02 (not like in the firt row 0:2) 

 

thanks ❤️ 

2 ACCEPTED SOLUTIONS
ppm1
Solution Sage
Solution Sage

tamerj1
Super User
Super User

Hi @matheuskei 

please try

Tempo Suprimido2 =
VAR String = 'Table'[Tempo Suprimido]
VAR Items =
SUBSTITUTE ( String, ",", "|" )
VAR Hours1 =
PATHITEM ( Items, 1 )
VAR Hours2 =
IF ( LEN ( Hours1 ) = 1, "0" & Hours1, Hours1 )
VAR Minutes1 =
PATHITEM ( Items, 2 )
VAR Minutes2 =
IF ( LEN ( Minutes1 ) = 1, "0" & Minutes1, Minutes1 )
RETURN
TIMEVALUE ( Hours2 & ":" & Minutes2 )

View solution in original post

5 REPLIES 5
matheuskei
New Member

Hey guys i just wanna say thanks for u support and everything ❤️ u are amazing. 

tamerj1
Super User
Super User

Hi @matheuskei 

please try

Tempo Suprimido2 =
VAR String = 'Table'[Tempo Suprimido]
VAR Items =
SUBSTITUTE ( String, ",", "|" )
VAR Hours1 =
PATHITEM ( Items, 1 )
VAR Hours2 =
IF ( LEN ( Hours1 ) = 1, "0" & Hours1, Hours1 )
VAR Minutes1 =
PATHITEM ( Items, 2 )
VAR Minutes2 =
IF ( LEN ( Minutes1 ) = 1, "0" & Minutes1, Minutes1 )
RETURN
TIMEVALUE ( Hours2 & ":" & Minutes2 )

ppm1
Solution Sage
Solution Sage

Please see this article.

Calculate and Format Durations in DAX – Hoosier BI

 

Pat

 

Microsoft Employee
nchr
Frequent Visitor

What is the data type of the measure that gives you the time? Is it DATETIME, is it seconds, minutes, fraction of the day?

 

If the tempoSuprimido measure is text, then maybe you can use this:

 

FORMAT( TIMEVALUE([TempoSuprimido]), "nn:ss")

tamerj1
Super User
Super User

Hi @matheuskei 

try by using TIMEVALUE function 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.