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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to convert time in MM:SS

Hi,

 

The whole data is based on seconds, Still, I would like to convert the data to MM: SS. Below was the formula I used but the calculation is working and unfortunately, the data was not validating correctly.

 

Response time in minutes = VAR duration = AVERAGE(CADD[Enter_to_Arrv_Seconds])
VAR Hours = INT ( Duration / 3600)
VAR Minutes = INT ( MOD( Duration - ( Hours * 3600 ),3600 ) / 60)
VAR Seconds = ROUNDUP(MOD ( MOD( Duration - ( Hours * 3600 ),3600 ), 60 ),0)
RETURN
(Minutes*100+ Seconds)+0
 
Below is the column in the table
 
FJ83_0-1652337748712.png

 

Kindly do the needful please !

 
 
1 ACCEPTED SOLUTION

Hi, @Anonymous 

In measure you cannot directly convert data to MM:SS.

You might consider using  character ‘&’ to concatenate characters to get the final result

Please modify your original formula as below:

Response time in minutes =
VAR _duration =
    AVERAGE ( CADD[Enter_to_Arrv_Seconds] )
VAR Hours =
    INT ( _duration / 3600 )
VAR Minutes =
    INT ( MOD ( _duration - ( Hours * 3600 ), 3600 ) / 60 )
VAR Seconds =
    ROUNDUP ( MOD ( MOD ( _duration - ( Hours * 3600 ), 3600 ), 60 ), 0 )
RETURN
    Hours * 60 + Minutes & ":" & Seconds

veasonfmsft_0-1652766760473.png

Best Regards,
Community Support Team _ Eason

View solution in original post

6 REPLIES 6
SanketBhagwat
Solution Sage
Solution Sage

Hi @Anonymous 
PLease try 'FORMAT" Dax function.
Refer below link;
https://docs.microsoft.com/en-us/dax/format-function-dax


Thanks,
Sanket
If this post helps, then mark it as 'Accept as Solution' and give it a thumbs up.

Anonymous
Not applicable

Previously we used this calculation and then format the measure at 00:00, Currently, they redefine the columns by enter_to_arrv_seconds (Data type - Whole number). 
 
The result should be in this format: 03:40
 
 
 
Hold time in Mins = VAR Duration = AVERAGEX(
DAC,DATEDIFF(DAC[IDDate],DAC[DispatchedTime],SECOND))
VAR Hours = INT ( Duration / 3600)
VAR Minutes = INT ( MOD( Duration - ( Hours * 3600 ),3600 ) / 60)
VAR Seconds = ROUNDUP(MOD ( MOD( Duration - ( Hours * 3600 ),3600 ), 60 ),0)
RETURN
(Minutes*100+ Seconds)+0

Hi, @Anonymous 

In measure you cannot directly convert data to MM:SS.

You might consider using  character ‘&’ to concatenate characters to get the final result

Please modify your original formula as below:

Response time in minutes =
VAR _duration =
    AVERAGE ( CADD[Enter_to_Arrv_Seconds] )
VAR Hours =
    INT ( _duration / 3600 )
VAR Minutes =
    INT ( MOD ( _duration - ( Hours * 3600 ), 3600 ) / 60 )
VAR Seconds =
    ROUNDUP ( MOD ( MOD ( _duration - ( Hours * 3600 ), 3600 ), 60 ), 0 )
RETURN
    Hours * 60 + Minutes & ":" & Seconds

veasonfmsft_0-1652766760473.png

Best Regards,
Community Support Team _ Eason

Anonymous
Not applicable

I'm looking the data validation side by doing the calculation based on the column i mentioned above,

@Anonymous , Hope it is number to time

New column = Quotient([Time in Second],60)  & ":" & MOD([Time in Second],60)  

 

or

TIme(Quotient([Time in Second],3600)  ,Quotient(Mod([Time in Second],3600) ,60), Mod(Mod([Time in Second],3600) ,60) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak 

 

How to find the average from the above calculation ?

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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