Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
i36
Regular Visitor

solution:Connect merge multiple database with same table in Power BI,powerquery 批量连接合并多个表结构相同数据库

this solution is my experience.

the English translation maybe not very well

 

0.汇总服务器地址和数据库名称为excel文件,文件名为

input servers as url , databases as database  as excel file named

 

database.xlsx

 

 xlsxxlsx

 

导入到powerquery编辑器中

Import into the powerquery editor

 

00

  1. 正常连接其中一个数据库,按提示输入服务器地址、数据库、相应的账户及密码。

Connect to one of the databases ,enter the server , database, correct account & password normally.

 

11

  • 2.在步骤1基础上创建函数

Create the function below based on step 1

 

fnsql

 

2.12.1

 

2.22.2

 

2.32.3

3.进入高级编辑器,将源=()()修改为

Go to the Advanced Editor and edit() to below where “source =()”.

 

url as text, database as text

填写过的服务器修改为

Modify the server that was filled  to

url

数据库修改为

Modify the database that was filled  to

database

3.13.1

 

3.23.2

 

4.复制步骤0的查询并粘贴

Copy the query from step 0 and paste it

 

4.14.1

 

4.24.25.在database(2)中添加自定义列

Add a custom column below in database(2).

 

fnsql([url],[database])

 

55

6.展开自定义列所需字段即可。

 

Expand the fields required for the custom column.

66

如果连接服务器时提示权限问题,请根据提示选择选项并输入数据库账户及密码

If you are prompted with permission questions when you connect to the server, follow the prompts to select options and enter the database account and password

1 REPLY 1
Anonymous
Not applicable

Hi @i36 ,

Thank you for your sharing. Please mark the reply to close the case and help more people find the answer.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.