Search code examples
xmlexcelpowerbipowerquerym

Import simple XML into Power BI


I am trying to import this simple XML data into Power BI (or Excel 2016):

https://resourcescrono.s3-eu-west-1.amazonaws.com/demo-biblio.xml

It's a simple XML, with a 3 column table (it even has the XSD schema attached). The same XML can be easily imported in former Excel versions (Excel 2003 and so on).

However, Power BI and Excel 2016 fails in multiple ways:

  • It seems to ignore schema data
  • It fails to detect invariant number formats.

How can get this data into my Power BI dashboard or Excel 2016?

Power BI screenshot

My regional settings are spanish, but I don't know the regional setting of my users (may vary).

UPDATE: Microsoft has accepted it as a bug. Excel should respect XSD schema: https://community.powerbi.com/t5/Issues/Bug-importing-simple-XML-file/idc-p/429822


Solution

  • The number conversion issue comes from the Table.TransformColumnTypes call. Power Query will try to parse the number using the workbook/pbix's locale settings. Therefore, it tries to parse a number like "83647.49" using a Spanish locale, and since (Spanish/International) Spanish uses commas as the decimal separator, the number will be read as an oddly-formatted representation of "8364749".

    The locale settings travel with the workbook/pbix, and you can set it in the Options dialog under Current Workbook | Regional Settings in Excel, and Current File | Regional Settings in PowerBI Desktop.

    I don't believe we support noNamepsaceSchemaLocation, but if you'd like to see support please suggest it at the Power BI Ideas site.