cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: How to convert date/time column to time column with hours and minutes (hh:mm) 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.

View solution in original post

6 REPLIES 6
Highlighted
Super User I
Super User I

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

@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 Super User!




Highlighted
Frequent Visitor

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

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

Highlighted
Microsoft
Microsoft

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

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.
Highlighted
Frequent Visitor

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

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. 

Highlighted
Microsoft
Microsoft

Re: How to convert date/time column to time column with hours and minutes (hh:mm) 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.

View solution in original post

Highlighted
Frequent Visitor

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

Hi Cherie, 

That works perfectly. Thank you very much. 

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors