Create a function query which does the manipulation on your source table, based on Path / File parameters:
fnGetDBF
(MyPath, MyFile) =>
let
Source = Odbc.DataSource("dsn=dBASE Files", [HierarchicalNavigation=true]),
Database = Source{[Name=MyPath,Kind="Database"]}[Data],
Table = Database{[Name=MyFile,Kind="Table"]}[Data]
// Your transformations here
in
Table
Use this function to combine all the dbf tables in a folder:
CombineDBFTables
let
Source = Folder.Files("C:\YourPath\DBF"),
#"Filtered Rows" = Table.SelectRows(Source, each [Extension] = ".dbf"),
#"Added MyPath" = Table.AddColumn(#"Filtered Rows", "MyPath", each Text.TrimEnd([Folder Path],"\")),
#"Added MyFile" = Table.AddColumn(#"Added MyPath", "MyFile", each Text.Replace([Name],[Extension],"")),
#"Get Tables" = Table.AddColumn(#"Added MyFile", "fnGetDBF", each fnGetDBF([MyPath], [MyFile])),
#"Combine Tables" = Table.Combine(#"Get Tables"[fnGetDBF])
in
#"Combine Tables"
Bookmarks