cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KGBOR
Frequent Visitor

Convert hh:mm:ss to mm:ss either in Power Query Editor or in DAX

I have a hh:mm:ss: value coming in from a raw data and I'd like to convert that to mm:ss as the time value itself is below 1 hour so the "hh" part brings no value. How can I convert or remove that "hh" part? I found that in Power Query editor I can get out the minutes and second separately and might be able to combine them but that'd just put way too burden on the entire model.

 

Thank you!

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @KGBOR ,

 

If the column is time type, you could try this formula:

 

Column = FORMAT('Table'[Column1],"nn:ss")

vjaywmsft_0-1653377635687.png

If the column is text type, you could try this formula:

Column = RIGHT('Table'[Column1],5)

vjaywmsft_1-1653377770976.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @KGBOR ,

 

If the column is time type, you could try this formula:

 

Column = FORMAT('Table'[Column1],"nn:ss")

vjaywmsft_0-1653377635687.png

If the column is text type, you could try this formula:

Column = RIGHT('Table'[Column1],5)

vjaywmsft_1-1653377770976.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
mahoneypat
Microsoft
Microsoft

Please see this article. The best way to handle durations is to keep them as a decimal, do your aggregations, and then format them at the end with "mm:ss".

Calculate and Format Durations in DAX – Hoosier BI

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


amitchandak
Super User
Super User

@KGBOR , new column in power query

#time(0,Time.Minute([TimeCol]) , Time.Seconds([TimeCol]) )



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Thank you @amitchandak ! For some reason it still kept the hh part at the beginning. Is there any method for such conversion?

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors