Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Xml processing fails, but succeeds after copy paste

I have an .xml file, obtained by using the export function of some software our customer uses, which he wanted to analyse with PowerBI. However, trying to load it with GetData results in the following error:


Details: "Xml processing failed. Either the input is invalid or it isn't supported. (Internal error: Name cannot begin with the '.' character, hexadecimal value 0x00. Line 1, position 2.)"


The .xml file doesn't have a period at this position, and no names seemed to start with a '.'. After some trial and error, I found that if I open the xml in notepad or sublime, copy it's entire contents with Ctrl-C, then paste it in a new xml file, save it, and upload that one, PowerBI loads it with no problem. This new .xml file also is significantly smaller than the original (110 vs 55 MB).


I can open the files and copy paste its content, but on the customer's computer this is difficult due to the file's size. Plus, the files are to be loaded into a blob storage so that PowerBI can combine their data. If there's one un-copy-pasted file in the blob storage, the refresh of the whole published dataset will silently fail from there on out, until the offending file is found and removed. This makes the copy-paste trick unreliable as a permanent fix.


Does anyone know what could be causing this problem, and what would be an easy way to fix it? If needed, here are two small sample files, one working, one not working. The not-working file The working file.

Community Support
Community Support

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

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Hy imous, did you found a solution for this problem?

Community Support
Community Support

Hi @imous,


I have reported this issue internally: CRI 43758511. Will update here once I get any information.


Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!


Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors