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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
SJi
Frequent Visitor

How to use stored procedure to get data?

 

Hello,

 

we have stored procedures made for our mobile and paginated reports and we would like to use them with PowerBI. The procedures often have temp tables and parameters. I've enabled opequery on our database, however I'm getting an error as show below. How can be stored procedure used to get data in PowerBI? Any help would be appreciated.

 

 

Details: "Microsoft SQL: The metadata could not be determined because statement 'SELECT 
		ROW_NUMBER () OVER (PARTITION BY a.MonthBack ORDER BY sum(a.ApprovedLoanAmount) DESC)	
AS' in procedure 'MR0001_MosRanking' uses a temp table."

 

2 REPLIES 2
SJi
Frequent Visitor

I've found there're basicaly 3 ways how to utilise stored procedure in Power BI:

  1. Using and executing variable
  2. Openquery
  3. Table-Valued Function

It seems, the most straightforward way is to execute variable which stores stored procedure call, however I'm having some troubles in doing so.

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @SJi,

 

Thanks for your sharing.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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.