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

Convert DateTime format from dd/mm/yyyy hh:mm:ss to dd/mm/yyyy hh

Please let me know how to convert a DateTime format from dd/mm/yyyy hh:mm:ss to dd/mm/yyyy hh in Power editor.

For example 01/01/2019 02:12:34 to 01/01/2019 02:00:00.

1 ACCEPTED SOLUTION

Accepted Solutions
Riantilo Frequent Visitor
Frequent Visitor

Re: Convert DateTime format from dd/mm/yyyy hh:mm:ss to dd/mm/yyyy hh

Edit: [start_time] is a DateTime column

Its not in the default transform options. I did accomplish this once using Power Query. It isn't pretty but it works.

I created a Custom Column with the following formula:
Text.From(Date.Day([start_time]))
&"/"&
Text.From(Date.Month([start_time]))
&"/"&
Text.From(Date.Year([start_time]))
&" "&
Text.From(Time.Hour(DateTime.Time([start_time])))
&":00:00"

After that select data type of the column and set it to Date/Time.

Gr,

Jesse

View solution in original post

2 REPLIES 2
doobie Regular Visitor
Regular Visitor

Re: Convert DateTime format from dd/mm/yyyy hh:mm:ss to dd/mm/yyyy hh

I don't believe that is a default option but this can be solved in DAX

 

=FORMAT(<value>, "dd/mm/yyyy hh")
Riantilo Frequent Visitor
Frequent Visitor

Re: Convert DateTime format from dd/mm/yyyy hh:mm:ss to dd/mm/yyyy hh

Edit: [start_time] is a DateTime column

Its not in the default transform options. I did accomplish this once using Power Query. It isn't pretty but it works.

I created a Custom Column with the following formula:
Text.From(Date.Day([start_time]))
&"/"&
Text.From(Date.Month([start_time]))
&"/"&
Text.From(Date.Year([start_time]))
&" "&
Text.From(Time.Hour(DateTime.Time([start_time])))
&":00:00"

After that select data type of the column and set it to Date/Time.

Gr,

Jesse

View solution in original post

Helpful resources

Announcements
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 182 members 1,797 guests
Please welcome our newest community members: