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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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