Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
How to get data from a SQL-server by using stored procedures with parameters in a Direct Query connection?
Facing Error (Microsoft SQL: Incorrect syntax near the keyword 'EXEC')
I've tried using Power Query's advanced editor and creating new parameters still facing the same error, but I'm wondering if there are any other methods I could try.
Solved! Go to Solution.
CREATE VIEW MyView AS
SELECT * FROM MyTable WHERE Column1 = 'Value1';
or use Query Folding by adding extra steps in using M Language
#"Filtered Rows" = Table.SelectRows(Sales, each [SaleDate] >= #date(2023, 1, 1) and [SaleDate] <= #date(2023, 12, 31))
Proud to be a Super User!
CREATE VIEW MyView AS
SELECT * FROM MyTable WHERE Column1 = 'Value1';
or use Query Folding by adding extra steps in using M Language
#"Filtered Rows" = Table.SelectRows(Sales, each [SaleDate] >= #date(2023, 1, 1) and [SaleDate] <= #date(2023, 12, 31))
Proud to be a Super User!
@SagarB Oh! I missed that , DirectQuery mode in Power BI does not support the execution of stored procedures directly. Instead, create a view or a table-valued function in the database and query this object in Power BI
Proud to be a Super User!
@VijayP "I reviewed the thread you mentioned, and it clearly states that this solution will only work for Import Mode. However, I am using Direct Query mode."
Please use this thread - https://community.fabric.microsoft.com/t5/Power-Query/Microsoft-SQL-Incorrect-syntax-near-the-keywor...
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
37 | |
31 | |
26 |
User | Count |
---|---|
92 | |
50 | |
44 | |
40 | |
35 |