cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
diskovered
Helper III
Helper III

How to convert mm:ss to seconds (duration)

How do I convert this to seconds either via measure or m. Help is much appreciated. Thanks

 

convert.PNG

1 ACCEPTED SOLUTION

Hi @diskovered

 

format the column with Power Query (M) as duration.

With Duration.TotalSeconds([Column]), you get the seconds.

 

Duration.png

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #
"Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

5 REPLIES 5
Ramaka_bnd
Regular Visitor

Split the column into two columns. One for minutes and one for seconds with the type number.

Then add a new column with like this
AddColNewSpeaktime = Table.AddColumn(ChangeColType, "Ø Sprechzeit", each #duration(0,0,[Ø Sprechzeit.1],[Ø Sprechzeit.2])),
AddcolNewWaittime = Table.AddColumn(AddColNewSpeaktime, "Ø Wartezeit", each #duration(0,0,[Ø Wartezeit.1],[Ø Wartezeit.2])),
#duration(0,0,0,0) need the type number

Hi @diskovered

 

format the column with Power Query (M) as duration.

With Duration.TotalSeconds([Column]), you get the seconds.

 

Duration.png

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #
"Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

Could you please explain this in more detail?

 

I have durations in my data set that are, for example, 7 minutes 17 seconds, but powerBI auto formats the duration to be 7 hours 17 minutes 0 seconds. How can I change this?

 

What is your source?

Is there a "Changed Type" step?

Maybe you could insert a "Add Prefix" step before the "Changed Type" step and change the value to this format "00:07:17".

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #
"Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Thanks. 

 

Got mine to work = Table.TransformColumns(#"Changed Type",{{"Value - Copy", Duration.TotalSeconds, type number}})

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors