Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I am trying to connect SQL Server to Power BI Using Custom Scripts,During this facing issue.
Regarding please check below Details -
Python Script -
import pandas as pd
import pyodbc
conn = pyodbc.connect('Driver={SQL Server};'
'Server= ServerName ;' - Mentioned Correctly
'Database=Test;' - Mentioned Correctly
'Trusted_Connection=yes;')
cur= conn.cursor()
sqlquery = pd.read_sql_query('SELECT * FROM Customers',conn) - Mentioned Correctly
print(sqlquery)
Note - I have already Installed libaries which are needed.
pip install pyodbc
pip install pandas
pip install matplotlib
Solved! Go to Solution.
Hi @Dnyaneshwar_21 ,
You can refer to the following official Microsoft link for a detailed description of the error and the solution, as the situation is caused by your specific situation, and you can follow the steps in the link to troubleshoot it,refer:
Best Regards
Lucien
Hi @Dnyaneshwar_21 ,
You can refer to the following official Microsoft link for a detailed description of the error and the solution, as the situation is caused by your specific situation, and you can follow the steps in the link to troubleshoot it,refer:
Best Regards
Lucien
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 51 | |
| 46 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 139 | |
| 112 | |
| 51 | |
| 33 | |
| 29 |