Join 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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |