MetricSign
EN|NLRequest Access
Medium severitydata quality

Power BI Refresh Error:
DF-Xml-InvalidDataField

What does this error mean?

The XML source contains a field that cannot be mapped to the ADF dataset schema. The field name doesn't match, or the value type is incompatible with the mapped column.

Common causes

  • 1The XML source file has a different element or attribute name than what is defined in the ADF dataset schema
  • 2The XML namespace in the file does not match the namespace defined in the dataset settings
  • 3A field in the XML contains a value that cannot be cast to the target data type — for example, an element mapped to an integer that contains the text 'N/A'
  • 4The XML structure changed (element renamed or restructured) but the dataset schema was not refreshed
  • 5A repeated element (array) is being mapped as a single value, causing a type conflict

How to fix it

  1. 1Read the error detail in the ADF activity run output — it names the field and the value that caused the failure.
  2. 2Open the XML dataset in ADF Studio and click Import Schema — this re-reads the current XML file structure and updates the schema to match the actual file.
  3. 3In debug mode, run a Data Preview on the XML source to see the actual field names and values being read.
  4. 4Compare the field name in the error with the element names in the XML file — check for namespace prefixes, case differences, and attribute vs element notation.
  5. 5If the field contains an unexpected value type (e.g., empty string mapped to integer), add a Derived Column transformation after the source to cast it safely: toInteger(iifNull(fieldName, '0')).
  6. 6If the XML structure uses namespaces, verify the namespace URI in the dataset matches the xmlns declaration in the actual XML files.

Frequently asked questions

Why does re-importing the schema help?

ADF stores a schema snapshot in the dataset at creation time. If the XML structure changes (fields added, renamed, or restructured), the stored schema becomes stale — re-importing reads the current file and updates field definitions.

How do XML namespaces affect field mapping in ADF?

ADF includes the namespace URI as part of field identity. <ns:CustomerID> is not the same as <CustomerID> — if the dataset was defined without namespace settings but the file uses them, every field name fails to match.

Can this error appear on some XML files but not others in the same folder?

Yes — if only some files have the problematic field or value, the error appears only for those files. Enable debug mode and narrow the source to the failing file with a wildcard filter.

Will downstream Power BI datasets be affected?

Yes — the pipeline fails and the downstream table receives no new data. Dependent datasets serve stale figures.

Official documentation: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-troubleshoot-guide

Other data quality errors