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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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