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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
censoft17
Frequent Visitor

Stored procedure parameter call with power bi

Hi,

I want to call my stored procedure written in Azure SQL Server to Power BI. I am facing an error like

 

Details: "Microsoft SQL: 'OPENQUERY' rowset provider not supported in this version of SQL Server."

 

The query i have written is 

SELECT *
FROM OPENQUERY ([servername],
'EXEC dbname.dbo.spname @StartDate = "StartDate",@EndDate = "EndDate"');

 

I have created two parameters in PowerBI namely - StartDate,EndDate.

I want to enter values manually at run-time for startdate & enddate parameter

 

Please provide your valuable feedback.

Thanks & Regards

 

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee


@censoft17 wrote:

Hi,

I want to call my stored procedure written in Azure SQL Server to Power BI. I am facing an error like

 

Details: "Microsoft SQL: 'OPENQUERY' rowset provider not supported in this version of SQL Server."

 

The query i have written is 

SELECT *
FROM OPENQUERY ([servername],
@'EXEC dbname.dbo.spname @StartDate = "StartDate",@EndDate = "EndDate"');

 

I have created two parameters in PowerBI namely - StartDate,EndDate.

I want to enter values manually at run-time for startdate & enddate parameter

 

Please provide your valuable feedback.

Thanks & Regards

 


@censoft17

  1. Azure SQL Server doesn't support  the OPENQUERY syntax.
  2. If using OPENQUERY syntax is to bypass the syntax error when executing a stored procedure in DirectQuery mode, no, it is an dead end.
  3. In Import mode, to execute a stored procedure with the parameters, you can try to modify in the advanced editor.
    let
        Source = Sql.Database("xxxxxx.database.windows.net", "AdventureWorksLT", [Query="exec DBNAME.dbo.SPNAME '"&Date.ToText(StartDate,"yyyyMMdd")&"','"&Date.ToText(EndDate,"yyyyMMdd")&"'"])
    in
        Source

View solution in original post

2 REPLIES 2
Eric_Zhang
Employee
Employee


@censoft17 wrote:

Hi,

I want to call my stored procedure written in Azure SQL Server to Power BI. I am facing an error like

 

Details: "Microsoft SQL: 'OPENQUERY' rowset provider not supported in this version of SQL Server."

 

The query i have written is 

SELECT *
FROM OPENQUERY ([servername],
@'EXEC dbname.dbo.spname @StartDate = "StartDate",@EndDate = "EndDate"');

 

I have created two parameters in PowerBI namely - StartDate,EndDate.

I want to enter values manually at run-time for startdate & enddate parameter

 

Please provide your valuable feedback.

Thanks & Regards

 


@censoft17

  1. Azure SQL Server doesn't support  the OPENQUERY syntax.
  2. If using OPENQUERY syntax is to bypass the syntax error when executing a stored procedure in DirectQuery mode, no, it is an dead end.
  3. In Import mode, to execute a stored procedure with the parameters, you can try to modify in the advanced editor.
    let
        Source = Sql.Database("xxxxxx.database.windows.net", "AdventureWorksLT", [Query="exec DBNAME.dbo.SPNAME '"&Date.ToText(StartDate,"yyyyMMdd")&"','"&Date.ToText(EndDate,"yyyyMMdd")&"'"])
    in
        Source

hi Eric,

StartDate, EndDate parameters are now working fine.

 

How to use these parameters as filter, once you publish the report.

I have added StartDate,EndDate parameter in slicer so that i can get filtered data in the table.

Please help me in using these parameters as filter on published report

 

Thanks & Regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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