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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

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

Top Solution Authors
Top Kudoed Authors