Skip to main content

Power BI

New

Read from zip files

Vote (42) Share
Taylor Clark's profile image

Taylor Clark on 12 Feb 2015 09:22:39

Allow me to browse and read from a zip file

Comments (5)
Taylor Clark's profile image Profile Picture

b1adafa9 36eb-4db0-b892-508675695031 on 05 Jul 2020 23:42:44

RE: Read from zip files

Not just locally, but an online one as well to allow for automatic refreshing (like the web connector does with a table in a website).

Taylor Clark's profile image Profile Picture

9dc6bdda 8684-4778-870b-d36d5b2ec0eb on 05 Jul 2020 23:06:25

RE: Read from zip files

Open CSV zipped files could be very useful.

Taylor Clark's profile image Profile Picture

3ea5dfc9 40c6-452a-b61f-218cdbef761d on 05 Jul 2020 22:42:13

RE: Read from zip files

Create a function using the code here
http://sql10.blogspot.com.au/2016/06/reading-zip-files-in-powerquery-m.html

Then to iterate over the files on the web page, do something like

let
GetCSVContents = (data) as table =>
let
files= unzipFile(data[Content]),
csv=Csv.Document(files[Content],[Delimiter=",", Columns=10, Encoding=1252, QuoteStyle=QuoteStyle.None])
in
csv,
f=unzipFile(Web.Contents("http://blah.com")),
combine=Table.AddColumn(f,"Contents",each GetCSVContents(_))
in
combine

Taylor Clark's profile image Profile Picture

a293687d 7b3e-4397-a4c7-b0087b964a87 on 05 Jul 2020 22:19:46

RE: Read from zip files

Maybe this can help you
http://www.excelandpowerbi.com/?p=155

Taylor Clark's profile image Profile Picture

d0aca558 5e84-498a-9cd8-6d63f1fe0aea on 05 Jul 2020 22:06:21

RE: Read from zip files

A lot of zip files are published by Government's web site in Japan.
These zip files include Excel files, CSV files.
Some zip files have folders in it.
I want to use Excel/CSV files as Power BI' "Web" data source,
to no-download/no-expand/updatable these files.