Forum Discussion

Sai_Akash's avatar
Sai_Akash
New Member
1 year ago
Solved

OLE DB or ODBC error: [DataFormat.Error] We couldn't convert to Number...

   I'm facing an issue when importing multiple files into Power Query in Power BI. I've tried different file formats (CSV, Excel, TXT) and removed unnecessary columns, but the problem persists. Even...
  • BA_Pete's avatar
    1 year ago

    Hi Sai_Akash ,

     

    Difficult to say exactly without more information, but the first thing I'd do is go to the query that is failing with this error, find any columns that are converted to a number type (Decimal or Whole Number/Integer) during the transformation, select them one by one and go to the Home tab > Keep Rows (dropdown) > Keep Errors. This should hopefully help you identify rows where a conversion error has occurred.

     

    Pete

  • BA_Pete's avatar
    BA_Pete
    1 year ago

     

    Hi Sai,

     

    The error you posted implies that you still have a row with a non-numerical value in it.

    Try adding a custom column like this, which you can then filter on to identify offending rows:

    if try Value.Is(Number.From([ID]), type number) otherwise false then "Numeric" else [ID]

     

    Pete