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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Elitlogik
Frequent Visitor

Binary.Decompress possible error?

Binary.Length(Web.Contents("https://epss.cyentia.com/epss_scores-current.csv.gz"))

 

Returns 1391340

 

Binary.Length(Binary.Decompress(Web.Contents("https://epss.cyentia.com/epss_scores-current.csv.gz"), Compression.GZip))

 

Returns 63

 

Why? Please help me.

4 REPLIES 4
jennratten
Super User
Super User

Sometimes the data will be chunked when compressed or encoded so you may be experiencing data loss if it's not handled accordingly.  Try querying the headers to get more info like below. The content length should be included in the response.

let
 searchText = "Power Query"
in
 Web.Headers(
 "https://www.bing.com",
 [
 RelativePath = "search",
 Query = [q = searchText]
 ]
 )

 

Hi, thank you for your response.

 

The Gzipped CSV from cyentia.com is what I want to fetch and analyze in Power BI.

Downloading it manually, Unzip with 7zip and open in Excel works fine.

Using the code in the original post results in a table with only one row.

 

Isn't it strange that a Compressed file is 1.4 MB compressed and 63 characters Decompressed?

That particular compression method is very old and is limited in bits.  

I understand. You mean that the Binary.Decompress with the Compression.GZip parameter is old code? Because GZip as a standard is still vewry widely used on the web.

 

Strangely enough it decompresses another 8 MB file from another source just fine.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors