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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SanchezDK
Frequent Visitor

How to convert date/time column to time column with hours and minutes (hh:mm) in Power Query?

Hi all, 

I have a Begin Time column of type date/time with data like: 

 

Begin Time

01-01-1998 05:56:12

01-01-1998 07:15:58

 

How can I convert this in Power Query to just showing time in a format with hours and minutes (NOT seconds)? 

Like this:

 

Begin Time

05:56

07:15

  

Hope that you can help. 

 

Best regards, 

Jacob

1 ACCEPTED SOLUTION

Hi @SanchezDK

 

You may refer to below:

= Table.TransformColumns(Source, {{"Begin Time", each Text.BetweenDelimiters(_, " ", ":", 0, 1), type text}})

Regards,

Cherie

Community Support Team _ Cherie Chen
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

6 REPLIES 6
PattemManohar
Community Champion
Community Champion

@SanchezDK Please try this.. as as new column in Power Query

 

= Table.AddColumn(#"Changed Type", "Text Between Delimiters", each Text.BetweenDelimiters(Text.From([DateTimeVal], "en-GB"), " ", ":", 0, 1), type text)

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Hi pattemmanohar, 

Thank you for your reply. Your solution would work. However, I was looking for a way to transform the current column (instead of adding a new) and keeping the time format (without the seconds). 

 

Best regards, 

Jacob

Hi @SanchezDK

 

You may use 'Format' for the column as below:

1.png

 

Regards,

Cherie

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

Hi and thank you for uour reply. This is a very nice feature - however, I cannot figure out to do the same in Power Query. 

Hi @SanchezDK

 

You may refer to below:

= Table.TransformColumns(Source, {{"Begin Time", each Text.BetweenDelimiters(_, " ", ":", 0, 1), type text}})

Regards,

Cherie

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

Hi Cherie, 

That works perfectly. Thank you very much. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.