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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
j_martinho
Helper I
Helper I

Descomprima el archivo .gz en Sharepoint a Power BI

¡Hola!

Intenté abrir el csv desde un archivo .gz asignado en Sharepoint, pero no pude. ¿Me puedes ayudar?

Usé la función a continuación y la consulta:

(zip) =>
let
Source =
        Binary.Decompress(
            File.Contents(
                zip),
                Compression.GZip
        ),
#"Imported" =
        Csv.Document(Source,[Delimiter=",", Columns=17, Encoding=65001, QuoteStyle=QuoteStyle.None]),

#"Promoted Headers" = Table.PromoteHeaders(#"Imported", [PromoteAllScalars=true])
in
#"Promoted Headers"

Consulta:

let
    Fonte = SharePoint.Files("https://xxx.sharepoint.com/sites/GSP/", [ApiVersion = 15]),
    #"Linhas Filtradas2" = Table.SelectRows(Fonte, each ([Extension] = ".gz")),
    UnpackGzips = Table.AddColumn(#"Linhas Filtradas2", "Custom", each fnUnpackGzipLinesFromBinary([Folder Path]&[Name])),
    #"Expanded Custom" = Table.ExpandTableColumn(UnpackGzips)
in
    #"Expanded Custom"

Error:

Expression.Error: 1 argumentos se pasaron a una función, que esperaba entre 3 y 4.
Detalhes:
Patrón
Argumentos[Lista]

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hola @j_martinho

Usé el código de abajo y funcionó para mí.

let
    Source = File.Contents("zip"),
    Decompressed = Binary.Decompress(Source, Compression.GZip),
    #"Imported CSV" = Csv.Document(Decompressed,[Delimiter="|",Encoding=1252]),
    #"Promoted Headers" = Table.PromoteHeaders(#"Imported CSV")
in
    #"Promoted Headers"

¿He respondido a tu pregunta? ¡Marca mi puesto como una solución! Apreciamos su Kudos!!

saludos
Pranit

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@j_martinho está recibiendo error en el paso de expansión? ¿Puedes confirmarlo? o háganos saber en qué paso está recibiendo este error.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hola @j_martinho

Usé el código de abajo y funcionó para mí.

let
    Source = File.Contents("zip"),
    Decompressed = Binary.Decompress(Source, Compression.GZip),
    #"Imported CSV" = Csv.Document(Decompressed,[Delimiter="|",Encoding=1252]),
    #"Promoted Headers" = Table.PromoteHeaders(#"Imported CSV")
in
    #"Promoted Headers"

¿He respondido a tu pregunta? ¡Marca mi puesto como una solución! Apreciamos su Kudos!!

saludos
Pranit

¡Obras!

Lo ajusté para que Power BI descargue el archivo directamente desde la web en lugar de asignarlo a Sharepoint. Y usé el código de colega @pranit828. ¡Gracias!

let
    Fonte = Web.Contents("https://data.brasil.io/dataset/covid19/caso_full.csv.gz"),
    Decompress = Binary.Decompress(Fonte, Compression.GZip),
    #"CSV Importado" = Csv.Document(Decompress,[Delimiter=",", Columns=17, Encoding=65001, QuoteStyle=QuoteStyle.None]),
    #"Cabeçalhos Promovidos" = Table.PromoteHeaders(#"CSV Importado", [PromoteAllScalars=true]),
    #"Tipo Alterado" = Table.TransformColumnTypes(#"Cabeçalhos Promovidos",{{"city", type text}, {"city_ibge_code", Int64.Type}, {"date", type date}, {"epidemiological_week", Int64.Type}, {"estimated_population_2019", Int64.Type}, {"is_last", type logical}, {"is_repeated", type logical}, {"last_available_confirmed", Int64.Type}, {"last_available_confirmed_per_100k_inhabitants", Int64.Type}, {"last_available_date", type date}, {"last_available_death_rate", Int64.Type}, {"last_available_deaths", Int64.Type}, {"order_for_place", Int64.Type}, {"place_type", type text}, {"state", type text}, {"new_confirmed", Int64.Type}, {"new_deaths", Int64.Type}})
in
    #"Tipo Alterado"

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors
Top Kudoed Authors