cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
igaca
Helper III
Helper III

Power Query: Text string to date conversion

How does one convert -for example- "September 16, 2019 8:00 AM" into "9/16/2019" without decomposing the text string into relevant constituent parts (months, days of month, year) then re-constituting and formatting?

 

Thanks for your input!

 

IG

1 ACCEPTED SOLUTION
gpoggi
Advocate V
Advocate V

Hi @igaca ,

 

Since the text has time inside, first conver it to DateTime and the extract the Date from this DateTime, for example if I you add this Custom Column:

 

Date.From(DateTime.From([Text Column]))

I'm extracting DateTime From text, and after that I'm extracting Date from this result in one line, this will return this:

table3.jpg

 

Any question, just let me know.

 

Regards,

 

Gian Carlo Poggi

View solution in original post

2 REPLIES 2
gpoggi
Advocate V
Advocate V

Hi @igaca ,

 

Since the text has time inside, first conver it to DateTime and the extract the Date from this DateTime, for example if I you add this Custom Column:

 

Date.From(DateTime.From([Text Column]))

I'm extracting DateTime From text, and after that I'm extracting Date from this result in one line, this will return this:

table3.jpg

 

Any question, just let me know.

 

Regards,

 

Gian Carlo Poggi

View solution in original post

Thank you, sir.

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Kudoed Authors