Forum Discussion

nirrobi's avatar
nirrobi
Helper V
10 years ago
Solved

PowerQuery read from folder with many zip file

Hi all,

 

Is there a way to load to powerquery in powerBI folder with many zip file?

I succeed to load all the zip files but when drill done got only non read data (GIBBERISH.)

 

I succeed to load one zip file using the excellent to below link:

http://www.excelandpowerbi.com/?p=155

  • Anonymous's avatar
    Anonymous
    10 years ago

    Hi nirrobi,

    Firstly, create UnzipContents function in Power BI Desktop following the instructions in this blog.

    Secondly, choose "New Source -> Blank Query", open the advanced editor and paste the following code, please replace the path to your own path.

    let
    path = "Path\Zipfolder",
    Source = Folder.Files(path),
    #"Filtered Rows to only .zip" = Table.SelectRows(Source, each ([Extension] = ".zip")),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows to only .zip",{"Content"}),
    #"Added Custom UnzipContents" = Table.AddColumn(#"Removed Other Columns", "Custom", each UnzipContents([Content]))
    in
        #"Added Custom UnzipContents"



    Thanks,
    Lydia Zhang

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi nirrobi,

    Firstly, create UnzipContents function in Power BI Desktop following the instructions in this blog.

    Secondly, choose "New Source -> Blank Query", open the advanced editor and paste the following code, please replace the path to your own path.

    let
    path = "Path\Zipfolder",
    Source = Folder.Files(path),
    #"Filtered Rows to only .zip" = Table.SelectRows(Source, each ([Extension] = ".zip")),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows to only .zip",{"Content"}),
    #"Added Custom UnzipContents" = Table.AddColumn(#"Removed Other Columns", "Custom", each UnzipContents([Content]))
    in
        #"Added Custom UnzipContents"



    Thanks,
    Lydia Zhang

    • nirrobi's avatar
      nirrobi
      Helper V

      thanks a lot!!!!!!

      I forgot to change the name of the queries to unzip...