The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
and when converting from text to Date, it gives back an error.
Can somebody help?
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.
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?
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.