Forum Discussion
Can't convert text to date
Hi, I can't convert a text to date column. My dates column has some empty / "NA" values in it.
When I try to convert to date type, I get an error that says "We can't automatically convert the column to Date type."
Any suggestions?
Anonymous
Please refer the below snippet to exclude "NA" from the data columns and convert from Text to Date.
For more details, please refer the below link to download the PBIX file for reference.
http://www.mediafire.com/file/obgpdl22wc58cq6/Zebing-DateTable-NA_exclude.pbix/file
If this post was helpful may I ask you to mark it as solution and give it some kudos?
BR
Venal.
5 Replies
- venal
Memorable Member
Anonymous
Please refer the below snippet to exclude "NA" from the data columns and convert from Text to Date.
For more details, please refer the below link to download the PBIX file for reference.
http://www.mediafire.com/file/obgpdl22wc58cq6/Zebing-DateTable-NA_exclude.pbix/file
If this post was helpful may I ask you to mark it as solution and give it some kudos?
BR
Venal.
- AnonymousNot applicable
Thanks Venal for the solution. As my original post indicated, I had already been trying to change the field to a date data type, but I was doint it in the "data" view of power bi instead of in the "model" / queries view. Not sure why this worked in the query but not the data view, but I'm glad it worked either way.
- v-diye-msft
Community Support
Hi Anonymous
It's the NA text affecting the format conversion. would you mind remove them or replace them with "null" and try again?
- AnonymousNot applicable
Tried, but same result. Thanks.