Forum Discussion
XML import problem
- 10 months ago
Hi GrahamR ,
You are correct this is the expected behavior.
The reason you are seeing only null values is that the plain text “Site A” is not retained when Power BI parses the XML. The Xml.Tables function processes only structured elements and attributes, and in your file, “Site A” appears as loose text before the <Shelf> and <Box> elements. As a result, it is considered mixed content and omitted during import.
Since this text does not make it into Power Query, it cannot be retrieved by any M or DAX expressions after the XML is loaded.
The best solutions are to either update the XML so that “Site A” is within its own tag or attribute, or to read the file as raw text and extract the relevant section before <Shelf> using text functions prior to converting it to XML.
In summary, your understanding is correct the data loss occurs during the XML parsing stage, and is not due to any issues with your process.
Thank you,Tejaswi
Hi Tejaswi
This is in some ways a relief (!) after 4 days of getting nowhere. I am going to use a workaround along the lines you suggest so I can get these reports out to the client.
My other takeaway is say thank you to yourself and to the wider community for responding with ideas and suggestions. This has been a life-saver!
Very best wishes, Graham