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.
Hi,
I am using DirectQuery Data Mode to fetch data from SQL Server for my Power BI Report. I followed the below steps:
Above configuration generated the following query:
When I open the Query, I can see the preview of that SP's output.
But when I click on Close and Apply, its giving me the following error:
How do I fix this?
Solved! Go to Solution.
Below solution worked for me.
hi @amustafa
Below is my query:
let
Source = Sql.Database("1.2.3.4,1234", "MyDB", [Query="EXEC [dbo].[MyStoredProc] '2023'"])
in
Source
I tried using your solution but its not working as expected.
I was able to run the following query in Direct Query mode instead of Import Query and load the data form Power Query just fine. I have also made it a paramaterized query.
let
CustomerID = customeridparam,
Source = Sql.Database("localhost", "AdventureWorks",
[Query="EXEC GetCustomerOrderSummary @customer_id = " & Text.From(CustomerID)])
in
Source
Proud to be a Super User!
Can you please paste your full M Code from Power Query? Here's a general code with correct syntax.
let
Source = Sql.Database(ServerName, DatabaseName),
Query = "EXEC YourStoredProcedure @Parameter1 = Value1, @Parameter2 = Value2",
Result = Source{[Schema="dbo",Item="YourStoredProcedure"]}[Data]
in
Result
Proud to be a Super User!
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 |
---|---|
14 | |
13 | |
9 | |
8 | |
7 |
User | Count |
---|---|
17 | |
10 | |
7 | |
6 | |
6 |