My requirement is, I need to combine excel sheets from multiple workbooks using Power BI.
Folders structure is like this Jan, Feb, Mar, April are the folder name, which consist of workbook name as Jan1, Jan12, Jan15, Feb1, Feb12 and so on and type 1, type 2 and type 3 are the sheet name in each workbook.
I would like to combine all type 1 sheet from Jan, Feb, Mar folder and I need to write a M function to repeat the process for all other types (i.e type 2 and type 3).
Could you please help me on this requirement using Power Query?
So far I tried to create a function to get the data from folder after then i doing manual steps to combine the data from workbooks.
(filepath)=>
let
Source = Folder.Files(filepath),
#"Filtered Rows1" = Table.SelectRows(Source, each not Text.StartsWith([Name], "~$")),
#"Filtered Hidden Files1" = Table.SelectRows(#"Filtered Rows1", each [Attributes]?[Hidden]? <> true),
#"Reordered Columns" = Table.ReorderColumns(#"Filtered Hidden Files1",{"Name", "Content", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path", "Source Type"}),
#"Removed Columns" = Table.RemoveColumns(#"Reordered Columns",{"Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path", "Source Type"})
in
#"Removed Columns"