Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I was trying to use the Stored procedure using Direct Query in Power BI on Prem OCT Version
I am getting the below error message while loading the data into Power BI desktop itself
"Incorrect Syntax near the Keyword EXEC. Incorrect Syntax near )".
Steps:
Connected source using GetData-> SQL Server-> DirectQuery ->Advance Option-> EXEC SPName
Power BI Desktop Version: 2.51.4885.1423 64-bit (October, 2017)
http://community.powerbi.com/t5/Desktop/Use-SQL-Store-Procedure-in-Power-BI/td-p/20269
You must be using DirectQuery mode, in which you cannot connect to data with stored procedures. Try again using Import mode or just use a SELECT statement directly.
Hi @arun_1047
I have played a bit with your scenario. Using just 'exec sp_proc' does not work indeed, the statement sent to the SQL Server is not syntactically correct:
select * from (exec sp_test) SourceQuery where 1 = 2
You can use OPENQUERY as mentioned here, however you'll need your SQL Server setup for data access.
Regards,
Maria
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
5 | |
4 | |
2 | |
2 | |
1 |
User | Count |
---|---|
7 | |
6 | |
6 | |
4 | |
3 |