Forum Discussion

juangomez's avatar
juangomez
Helper I
6 years ago
Solved

Import Multiple Tables from Excel in a Single Query

Hi Everyone   I am currently importing several tables from Excel Workbooks. And it is distributed in several sheets. I have 3 different sheets: - Volume - Sales - Units   Each sheet is a big ...
  • v-frfei-msft's avatar
    6 years ago

    Hi juangomez ,

     

    We can get data by folder to work around.

     

    let
        Source = Folder.Files("D:\Case\20200212\testfolder"),
        #"Removed Columns" = Table.RemoveColumns(Source,{"Extension", "Date accessed", "Date modified", "Date created", "Folder Path", "Attributes"}),
        #"Added Custom" = Table.AddColumn(#"Removed Columns", "Custom", each Excel.Workbook([Content],true)),
        #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Name", "Data", "Item", "Kind", "Hidden"}, {"Custom.Name", "Custom.Data", "Custom.Item", "Custom.Kind", "Custom.Hidden"}),
        #"Expanded Custom.Data" = Table.ExpandTableColumn(#"Expanded Custom", "Custom.Data", {"a", "b", "c"}, {"Custom.Data.a", "Custom.Data.b", "Custom.Data.c"}),
        #"Removed Columns1" = Table.RemoveColumns(#"Expanded Custom.Data",{"Content"})
    in
        #"Removed Columns1"
    

     

    For more details, please refer to the third - party article.

    https://www.howtoexcel.org/power-query/how-to-import-multiple-files-with-multiple-sheets-in-power-query/