简体   繁体   English

将多个 mdb 文件中的多个表导入 excel 或 Power BI?

[英]Import multiple tables from multiple mdb files into excel or Power BI?

Is it possible to import multiple tables from multiple.mdb files into excel or power BI?是否可以将 multiple.mdb 文件中的多个表导入 excel 或 power BI? My.mdb files have tables which are in the same structure. My.mdb 文件具有相同结构的表。

Ex.前任。 first_file.mdb contains table A, table B second_file.mdb contains table A2, table B2 table A and table A2 has same structure, so as B and B2 first_file.mdb 包含表 A,表 B second_file.mdb 包含表 A2,表 B2 表 A 和表 A2 具有相同的结构,因此 B 和 B2

When I tried, excel only allow to import multiple table when select only 1 mdb file, but when import as folder (multiple mdb files), multiple table selection mode is gone.当我尝试时,excel 只允许在 select 只有 1 个 mdb 文件时导入多个表,但是当作为文件夹(多个 mdb 文件)导入时,多表选择模式消失了。

With the help of Power Query it is totally possible.在 Power Query 的帮助下,这是完全可能的。 Once the files are displayed in the Power Query DataGrid, the 'Content' column will list the (same) object that should be worked on in each of the files.一旦文件显示在 Power Query DataGrid 中,“内容”列将列出应该在每个文件中处理的(相同的)object。 You will have to adapt the proper reading of the objects within the query steps.您必须在查询步骤中调整对象的正确读取。 The M code below can be your start to do this.下面的 M 代码可以让您开始执行此操作。 (note that the folder location must be changed here, to suit your scenario and that only ".mdb" files are allowed in this sample): (请注意,必须在此处更改文件夹位置,以适合您的场景,并且此示例中只允许使用“.mdb”文件):

let
    Source = Folder.Files("C:\Users\YourUserName\Desktop\Access"),
    #"Lowercased Text" = Table.TransformColumns(Source,{{"Extension", Text.Lower, type text}}),
    #"Filtered Rows" = Table.SelectRows(#"Lowercased Text", each [Extension] = ".mdb")
in
    #"Filtered Rows"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM