Forum Discussion
Error opening .csv: DataFormat.Error: Block length does not match its plugin.
Hi nsalvay ,
According to the M function you provided, I think your problem should be that the data from your REST API is stored as a compressed JSON document, which is recognized as invalid format in Power BI Desktop.
Maybe you can try to use Binary.Decompress() function to extract the data, or use the Web.BrowserContents function instead of Web.Contents.
And here I find a blog with two solutions to this problem:
"Block length does not match with its complement" Error In Power Query (crossjoin.co.uk)
Solved: Connect to API in Power Query - Error: Block lengt... - Microsoft Fabric Community
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous, thanks for the answer. I tried what the blog indicates, but I couldn't get it to work.
1st I added the code #"Accept-Encoding" = "gzip" inside the Header in Web.Contents, but the error remained the same.
2nd I tried using Web.BrowserContents instead of Web.Contents, but I get an error with the header, like it doesn't support it:
3rd I tried decompressing the binary content using the Binary.Decompress() function, and all the decompression formats but the error remained the same.
Greetings
- nsalvay2 years agoFrequent Visitor
Hi Anonymous , There I managed to see the .csv file, but apparently it has bzip2 compression. I couldn't find information on how to unzip it, do you know if this is possible from power query?
Greetings and thanks!
ā