Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Team,
In my project i have requirement to execute stored procedure using 2 dynamic parameter in Direct query method. I am able to execute the procedure using one parameter. But, when I try to execute 2 parameter i am getting error.
Below is the screenshot of power M query code from advance editor. and error also attaching.
It would be really helpful if anyone of here can help me to fix this issue.
Thanks in advance.
count your single quotes. You are missing a couple and forgot to escape others.
After checking all the quotes still i am getting the same error.
let
CompanyId = Text.From(P_COMPANY_ID), // Ensure P_COMPANY_ID is defined
PeriodRange = Text.From(periodRange), // Ensure periodRange is defined
EscapedPeriodRange = "'" & Text.Replace(PeriodRange, "'", "''") & "'", // Escape single quotes in periodRange
Query = "SELECT * FROM OPENROWSET('SQLNCLI','Server=.......\XportUAT;Trusted_Connection=yes;','EXEC Xport_UAT_NEW.dbo.USP_GET_PERIOD_DATA_FS_BY_PERIODRANGE_SH @pCompany_Id=" & CompanyId & ", @PeriodRange=" & EscapedPeriodRange & "')",
Source = Sql.Database("......\XportUAT", "Xport_UAT_NEW", [Query=Query])
in
SourceI tried new above code. Could you please let me know where i am doing mistake. it would be helpful if you can suggest me in detail.
what's the purpose of
SELECT * FROM OPENROWSET
?
Looks like your SP is not even part of the query.
SELECT * FROM OPENROWSETThat link is irrelevant and/or misleading.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.