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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
manoj_0911
Post Patron
Post Patron

Connecting Power BI Desktop to Stored Procedures: Feasibility and Best Practices

Hello Power BI Community,

 

I'm currently exploring the capabilities of Power BI Desktop and have a question regarding its integration with stored procedures:

 

1. Feasibility: Is it possible to connect Power BI Desktop directly to stored procedures in databases such as SQL Server? If so, what are the steps involved in establishing this connection?

 

2. Best Practices: What are the best practices for connecting Power BI Desktop to stored procedures? Are there any considerations or limitations I should be aware of, such as parameterized queries or data type compatibility?

 

3. Performance Impact: How does connecting to stored procedures affect the performance of Power BI reports, particularly in scenarios involving large datasets or complex queries?

 

4. Data Refresh: Can Power BI Desktop handle automatic data refreshes when connected to stored procedures, or is manual data refreshing required?

 

Any insights or recommendations from your experience would be greatly appreciated.

 

Thank you for your assistance!
Manoj Prabhakar

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@manoj_0911 , It will not work for all database

 

example from SQL server

https://www.c-sharpcorner.com/article/execute-sql-server-stored-procedure-with-user-parameter-in-pow...

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

Hi @manoj_0911 

 

To use a stored procedure in Power BI, you’ll need to create it in your database server, not within Power BI itself. Most database management systems provide tools and interfaces that allow you to create and manage stored procedures easily.

Once you’ve created your stored procedure on the database server, you can connect to it from Power BI. To do this, follow these steps:

  1. Open Power BI Desktop and click on “Get Data.”
  2. Select your database connection and navigate to the “SQL Server database” option.
  3. Enter your server name, database name, and select “Database” instead of “SQL statement.”
  4. Choose the stored procedure from the list provided or enter the EXEC command followed by the stored procedure name.
  5. Power BI will connect to your stored procedure and display the result set.

These links can help:

How to Use Stored Procedure in Power BI - Zebra BI

How to Connect Power BI to SQL Server Stored Procedures - Monocroft

How to use SQL Server stored procedures in Microsoft PowerBI? - Stack Overflow

 

Best Regards

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @manoj_0911 

 

To use a stored procedure in Power BI, you’ll need to create it in your database server, not within Power BI itself. Most database management systems provide tools and interfaces that allow you to create and manage stored procedures easily.

Once you’ve created your stored procedure on the database server, you can connect to it from Power BI. To do this, follow these steps:

  1. Open Power BI Desktop and click on “Get Data.”
  2. Select your database connection and navigate to the “SQL Server database” option.
  3. Enter your server name, database name, and select “Database” instead of “SQL statement.”
  4. Choose the stored procedure from the list provided or enter the EXEC command followed by the stored procedure name.
  5. Power BI will connect to your stored procedure and display the result set.

These links can help:

How to Use Stored Procedure in Power BI - Zebra BI

How to Connect Power BI to SQL Server Stored Procedures - Monocroft

How to use SQL Server stored procedures in Microsoft PowerBI? - Stack Overflow

 

Best Regards

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

amitchandak
Super User
Super User

@manoj_0911 , It will not work for all database

 

example from SQL server

https://www.c-sharpcorner.com/article/execute-sql-server-stored-procedure-with-user-parameter-in-pow...

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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