Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
i want to extract from the latest gz file in a folder the csv file and continue with transforming. But it won't work out.... can someone help out?
= let
Quelle = Folder.Files("C:\xyz\folder"),
#"Sortierte Zeilen" = Table.Sort(Quelle,{{"Date created", Order.Descending}}),
#"Beibehaltene erste Zeilen" = Table.FirstN(#"Sortierte Zeilen",1)
Decompressed = Binary.Decompress(Source, Compression.GZip),
#"Imported CSV" = Csv.Document(Decompressed,[Delimiter="", Encoding=1252),
in
#"Imported CSV"
Thanks
Hi, @VTom
you need to add GetBinary = KeptFirstRow{0}[Content], before decompressing. to keep only the first row, which is the latest file.
so your modified code will be something like
let
Source = Folder.Files("C:\xyz\folder"),
SortedRows = Table.Sort(Source,{{"Date created", Order.Descending}}),
KeptFirstRow = Table.FirstN(SortedRows,1),
GetBinary = KeptFirstRow{0}[Content],
Decompressed = Binary.Decompress(GetBinary, Compression.GZip),
ImportedCSV = Csv.Document(Decompressed,[Delimiter=",", Encoding=1252])
in
ImportedCSV
Also, this tutorial will be helpful.
Proud to be a Super User!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.