Forum Discussion
Data Format Error in Powerbi Service
- 9 months ago
Hi Batman020,
If you're using Excel files and not XML files, there is no need to do any XML parsing. Use the Excel file connector, or the Web or SharePoint Folder connectors to connect and parse the Excel file directly.
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.
Hi Batman020
The error you’re seeing — “DataFormat.Error: Xml processing failed... Reference to undeclared entity 'ndash'” — indicates that one of the files being imported from your SharePoint folder contains invalid XML content or a special character (in this case, “–” representing an en dash) that Power BI’s parser can’t interpret. This usually happens when Power BI encounters a nonstandard or malformed XML/HTML entity in a file it’s trying to read (often in Excel, XML, or HTML exports). Because the error message doesn’t specify which document is causing it, you’ll need to isolate it manually. The best way to do this is to open your Power BI file in Power BI Desktop, go to Power Query Editor, and step through the applied steps of your SharePoint Folder query. At the point where the query expands or transforms files, add a temporary step (e.g., filter by file name or extension) and preview each file’s content until the error appears. This will reveal which specific file or files contain invalid XML characters. Once identified, open that file in a text or XML editor, replace or remove the “–” entity (or save the file in UTF-8 format), and re-upload it to SharePoint. Then refresh again in Power BI. Essentially, the issue isn’t with the connection but with malformed data in one or more of your source files, and checking the files individually in Power Query is the most efficient way to pinpoint and fix it.