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
Amanda_Mendez
Regular Visitor

Decimal to minutes and seconds

HELP! I have the next values :

Amanda_Mendez_0-1666130003705.png

When i open Power Query I set the data as duration and I can see the seconds and minutes, BUT when i close and apply this is the data I get 😞  I have tried the many solutions I found here but none has worked, I have no idea what to do next please help. 

 

PS: I tried this code but I get error 

Conversacion real time =
 
VAR _Seconds = SELECTEDVALUE('1'[CONVERSACION REAL.1])
VAR _Minutes = INT ( DIVIDE ( _Seconds, 60 ) )
VAR _RemainingSeconds = MOD ( _Seconds, 60 )
VAR _RemainingMinutes = MOD ( _Minutes, 60 )
RETURN
IF (
NOT ISBLANK ( _Seconds ),
FORMAT ( quotient(_Seconds,60), "00" ) & ":" & FORMAT ( mod(_Seconds,60), "00" ))
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Amanda_Mendez 

 

There is not much problem with your formula.

Column:

vzhangti_0-1666166348191.png

You also need to convert the text format to a time format. You can use the function TIMEVALUE. 

TIMEVALUE function (DAX) - DAX | Microsoft Learn

Conversacion real time = 
 VAR _Seconds = [Time]
VAR _Minutes = INT ( DIVIDE ( _Seconds, 60 ) )
VAR _RemainingSeconds = MOD ( _Seconds, 60 )
VAR _RemainingMinutes = MOD ( _Minutes, 60 )
RETURN
TIMEVALUE(IF (
NOT ISBLANK ( _Seconds ),
FORMAT ( quotient(_Seconds,60), "00" ) & ":" & FORMAT ( mod(_Seconds,60), "00" )))

vzhangti_1-1666166481982.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @Amanda_Mendez 

 

There is not much problem with your formula.

Column:

vzhangti_0-1666166348191.png

You also need to convert the text format to a time format. You can use the function TIMEVALUE. 

TIMEVALUE function (DAX) - DAX | Microsoft Learn

Conversacion real time = 
 VAR _Seconds = [Time]
VAR _Minutes = INT ( DIVIDE ( _Seconds, 60 ) )
VAR _RemainingSeconds = MOD ( _Seconds, 60 )
VAR _RemainingMinutes = MOD ( _Minutes, 60 )
RETURN
TIMEVALUE(IF (
NOT ISBLANK ( _Seconds ),
FORMAT ( quotient(_Seconds,60), "00" ) & ":" & FORMAT ( mod(_Seconds,60), "00" )))

vzhangti_1-1666166481982.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Pls help again. I get this data, is there a way to also show seconds? for example 17.39 = 00:17:23, thank you in advance 🙂 
Amanda_Mendez_0-1666195301396.png

 

YES! thank you so much, it is now in hh:mm:ss format. 🎊

amitchandak
Super User
Super User

@Amanda_Mendez , Change data type time and try

 

Or create a new column in dax

time(0,0,0) + [Column in hours]/24

 

or

 

time(0,0,0) + [Column in Minute]/(24*60)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.