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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

convert miliseconds to minutes:seconds

 

i have the following column duration in a table.

 

Duration
 
3000
2000
4000
70000
13000

 

want following output

 

Mins:sec
 
0.03
0.02
0.04
1.01
2.01
1 ACCEPTED SOLUTION
themistoklis
Community Champion
Community Champion

Hi @Anonymous

 

First i think you have a few errors with your raw data.

 

Instead of 13000 it should be 130,000 and the conversion will be 02:10 instead of 2.01

Same for 70000. It needs to be 01:10.

 

Please see workspace with the conversion on this link.

 

You need to create the following 2 calculated columns:

 

Duration New = 'Table'[Duration] * 0.001   // Conversion from milliseconds to seconds

 

Conversion = 
VAR Minutes =
    INT ( 'Table'[Duration New] / 60)

VAR Seconds =
    ROUNDUP(MOD ( 'Table'[Duration New], 60 ),0) // We round up here to get a whole number

VAR M =
    IF (
        LEN ( Minutes ) = 1,
        CONCATENATE ( "0", Minutes ),
        CONCATENATE ( "", Minutes )
    )
// Seconds with leading zeros
VAR S =
    IF (
        LEN ( Seconds ) = 1,
        CONCATENATE ( "0", Seconds ),
        CONCATENATE ( "", Seconds )
    )
RETURN
CONCATENATE(CONCATENATE(M, ":"), S)

 

View solution in original post

4 REPLIES 4
themistoklis
Community Champion
Community Champion

Hi @Anonymous

 

First i think you have a few errors with your raw data.

 

Instead of 13000 it should be 130,000 and the conversion will be 02:10 instead of 2.01

Same for 70000. It needs to be 01:10.

 

Please see workspace with the conversion on this link.

 

You need to create the following 2 calculated columns:

 

Duration New = 'Table'[Duration] * 0.001   // Conversion from milliseconds to seconds

 

Conversion = 
VAR Minutes =
    INT ( 'Table'[Duration New] / 60)

VAR Seconds =
    ROUNDUP(MOD ( 'Table'[Duration New], 60 ),0) // We round up here to get a whole number

VAR M =
    IF (
        LEN ( Minutes ) = 1,
        CONCATENATE ( "0", Minutes ),
        CONCATENATE ( "", Minutes )
    )
// Seconds with leading zeros
VAR S =
    IF (
        LEN ( Seconds ) = 1,
        CONCATENATE ( "0", Seconds ),
        CONCATENATE ( "", Seconds )
    )
RETURN
CONCATENATE(CONCATENATE(M, ":"), S)

 

Anonymous
Not applicable

want to show in a bar chart employe wise call duration 

 

when i was sum the conversion column its not give expected output in a chartconversion column works like thisconversion column works like thisexpect like thisexpect like this

 

 

 

 

 

Make sure that the conversion column is not text format.
If it is, change it from modelling tab to mins:secs
Anonymous
Not applicable

How to change it to mins:sec and what is modelling tab?

can you please explain, this would be helpful, really.

 

Thanks @themistoklis 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors