Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Help Connecting to a Zip File from a Web source

Hi guys,

I need help to solve this problem.

 

I have this source:

 

http://res1104.se.gob.ar/adjuntos/precios_eess_2013_en_adelante.zip

 

I use WEB SOURCE to connect the file and I can't decompress it. My code is this:

 

let
Source = Web.Contents("http://res1104.se.gob.ar/adjuntos/precios_eess_2013_en_adelante.zip"),
Decompress = Binary.Decompress(Source, Compression.GZip)
in
Decompress

 

The error PowerQuery show me is:   

DataFormat.Error: The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.

 

How can I do to solve it?

 

Thanks a lot.

 

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Looks like it is not a GZip format.  You can replace Compression.GZip with one of the other compression types.  Just start typing Compression to see the options (if intellisense is enabled in your file).

If one of those doesn't work, you can try the custom function described in this article.

Reading Zip files in PowerQuery / M (sql10.blogspot.com)

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

Modify the M code as below:

let
Source = Web.Contents("http://res1104.se.gob.ar/adjuntos/precios_eess_2013_en_adelante.zip",[Headers=[#"Accept-Encoding"="gzip"]]),
Decompress = Binary.Decompress(Source, Compression.GZip)
in
Decompress

Check the similar thread below:

https://stackoverflow.com/questions/33790650/does-power-query-support-accept-encoding-gzip-in-web-contents

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

mahoneypat
Microsoft Employee
Microsoft Employee

Looks like it is not a GZip format.  You can replace Compression.GZip with one of the other compression types.  Just start typing Compression to see the options (if intellisense is enabled in your file).

If one of those doesn't work, you can try the custom function described in this article.

Reading Zip files in PowerQuery / M (sql10.blogspot.com)

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.