Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tebtim19
Helper IV
Helper IV

cannot convert value of type text to type Date

I tried to combine the column Date and EndDate I have with a formula dd/mm/yy
using this Projects = ([Date] & "--" &[EndDate])
 
but it gives me an output of the combination with the formula of mm/dd/yy
 
I check the data type it is in text and when I change it to Date it gives me an error message
cannot convert value of type text to type Date  any idea? 
 
 
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @tebtim19 

There is another method you can take in Query Editor. Since the Date columns are in Text type, you can add a custom column as below.

= [Date]&"--"&[EndDate]

11092.jpg

 

If you want to change the data type without an error, you can right click the column -> Change Type -> Using Locale... and set the data type as Date with origin locale.

11091.jpg

After that, you can add a custom column like below.

= Date.ToText([Date])&"--"&Date.ToText([EndDate])

11093.jpg 

Best Regards,

Community Support Team _ Jing Zhang

If this post helps, please consider Accept it as the solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @tebtim19 

There is another method you can take in Query Editor. Since the Date columns are in Text type, you can add a custom column as below.

= [Date]&"--"&[EndDate]

11092.jpg

 

If you want to change the data type without an error, you can right click the column -> Change Type -> Using Locale... and set the data type as Date with origin locale.

11091.jpg

After that, you can add a custom column like below.

= Date.ToText([Date])&"--"&Date.ToText([EndDate])

11093.jpg 

Best Regards,

Community Support Team _ Jing Zhang

If this post helps, please consider Accept it as the solution to help other members find it.

PhilipTreacy
Super User
Super User

Hi @tebtim19 

Not entirely clear but Either Date and / or EndDate have text that can't be converted to date.  Which column did you try changing the data type for?

Can you share some data? Even screen shots?

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.