Forum Discussion
Xml processing fails, but succeeds after copy paste
Hi imous,
I got response below from PG internally:
This file is encoded with UTF-16 but does not include a Unicode BOM. To load it into Power BI, the customer will need to specify the encoding explicitly with
= Xml.Document(File.Contents("C:\...\WrongDemo.xml"), TextEncoding.Unicode)
Based on my test, you can create a blank query, and use this Power Query to get data from WrongDemo.XML file.
Best Regards,
Qiuyun Yu
Thank you. I can get your solution to work on my end too. I haven't been able to get it to work with Xml.Tables instead of Xml.Document yet (I get an error that value=1200 can't be converted), but that is probably solvable.
However, unless I'm mistaken, I don't think this solution will work for the desired link of this PowerBI project to an Azure Blob Storage which contains the xmls. In those cases, I don't define explicitly which xml files it needs to load, and in fact it's designed so I don't need to know or define this. This way the customer can just store new xmls and be sure their data gets added to the project. But for this fix, I do need to define explicitly the xml files and their locations. If I'm assuming incorrectly here, let me know.
For my part, I'll see what we can do about the original encoding of the xmls. I doubt the program that exports those files can be customized in this regard, but I can try.
- MacJulian5 years agoAdvocate I
Hy imous, did you found a solution for this problem?