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
Anonymous
Not applicable

How to turn a column into a date type if it has 2 different date patterns?

Hello everyone,

I have a column that has dates of different types.
Example: 01/15/2020 and 1/15/20


When I try to pass this column to the date type, PowerBi shows rows with an error, because it is unable to convert all the rows in this column to date, due to the difference in the pattern in the dates. How can I work around this problem?

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

Is your issue solved now?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Ashish_Mathur
Super User
Super User

Hi,

I don't think it is because of date of different format.  I think it is because of the entries which look like dates are not dates at all.  If your systems settings are set to dd/mm/yyyy format, then 1/15/2020 will not be recognised as a date at all.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
NamishB
Post Prodigy
Post Prodigy

Hi @Anonymous : To me this looks like data cleansing/Formatting issue. You might first need to clean and analyse your data

Easy way to do is in Power Query Mode > Select Table > View > Enable Column Distribution, Enable Column Profile and Enable Column Quality

Then you will need to fix any errors with the data. M code will be generated in the backend

 

Unfortunately there is no other way of automating data cleansing, Not atleast i am aware of.

 

Hope this helps.

 

Cheers,

-Namish B

 

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.