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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
elimey
Helper I
Helper I

Import from CSV gives error on Date conversion

I am trying to import a csv file, I have two issues:
- first, all the columns are being imported as Text. Even with "Always detec data type" option on, everything is imported as text. What can I do? 
- Second, all of the date columns are like this:

elimey_0-1701867786491.png

and when converting from text to Date, it gives back an error. 

 

Can somebody help?

 

4 REPLIES 4
Anonymous
Not applicable

Change the data type when importing to text and not date.

Then, you can handle the column with a transformation to extract date into a new column.

The error will be displayed in the row for those dates that are invalid.

You can then copy the query and filter rows in new query for only those with errors.

You can filter the original query those rows with no errors.

 

HotChilli
Super User
Super User

Both issues are related. If powerbi can't convert the field to date without throwing an error it can't recognise it as a legitimate date.

You will have to handle the conversion (either by splitting the field by delimiter - on space, or Text.Start() function or some other method) to get a format that will easily convert to date type.

when I open the csv as Excel, and load it to PowerBI, it works perfectly. But, when with CSV, it won't work. 
I am trying to find a best solution, cause I have many columns in the CSV and I can't do manual conversion for all of them. 
Is ther eany other solution?

Anonymous
Not applicable

My suggestion is so you can find the row(s) giving you the error. This will help determine what is causing the problem. Excel might have so intelligence to handle the issue that Power Query does not have.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors