cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AJTindall73 Frequent Visitor
Frequent Visitor

Re: parameters to SP or Sql query

Hi Sven, just dont add the "Text.ToText" part. it's already text.

 

for example:

 

let
    SQLSource = (param1 as text, param2 as date) =>
let  
    Source = Sql.Database("MyServer", "MyDatabase", [Query="exec [MyDatabase].[dbo].[myProc] '"& param1 & "','" & Date.ToText(param2)&"'"])
in
    Source
in
    SQLSource

 I hope this helps.

 

Alan

SvenTexas Frequent Visitor
Frequent Visitor

Re: parameters to SP or Sql query

Thank you Alan - can't believe I missed the obvious!  Thank you for putting the response on, am sure it will help others out too.

Juramirez Member
Member

Re: parameters to SP or Sql query

Hi @v-yuezhe-msft,

 

I'm dealing with something like this but this doesn't work for me. I want, in the step 3, fill these values with the value from an app. It's is possible? Full post is available here.

Thanks in advance

Julian

rohitpaliwal Frequent Visitor
Frequent Visitor

Re: parameters to SP or Sql query

Guys do we've a solution for this, I've similar requirement, I've got four drop downs in my report

 

1. Country

2. State

3. City

4 Store

 

the navigation is working fine, but I've a requirement to take this to next level i.e. in each drop down I've option to select either one or all, now once the selection is made, I want to use this as a input parameter for a stored procedure which resides in my sql server database.

I understand that in the new query editor I can use the stored procedure but how do I populate the parameter from the drop down visualization i.e. slicer in my case (I can use some other visualization aslo), first will list country, second will have states, third will have city and fourth will have storeIDs, now I can either have all selected or any indivudial values and on the basisi of this select tion, my procedure should execute like below

 

exec dbo.myproc countryid = @countryvar,  stateid = @statevar, cityID = @cityID, storeDi = @storeID

azizimranz Frequent Visitor
Frequent Visitor

Re: parameters to SP or Sql query

@SvenTexas

 

let
SQLSource = (Start_Date as date, End_Date as date, Fund_Name as text) =>

 

 

Not sure... is this what you were looking?

mskhurram Frequent Visitor
Frequent Visitor

Re: parameters to SP or Sql query

 

Guys, you dont need to use Text.ToText, It is required for only non text values. 

for example: '"& VariableName & "'

mskhurram Frequent Visitor
Frequent Visitor

Re: parameters to SP or Sql query

 

Guys, you dont need to use Text.ToText, It is required for only non text values. 

for example: '"& VariableName & "'

sesin Frequent Visitor
Frequent Visitor

Re: parameters to SP or Sql query

I use like  '"&Text.From(Period)& "'

sesin Frequent Visitor
Frequent Visitor

Re: parameters to SP or Sql query

I use like  '"&Text.From(Period)& "'

sbahugu2 Regular Visitor
Regular Visitor

Re: parameters to SP or Sql query

Seems this is a solution for PBI desktop only.

Dont know what will be the benifit of this if we have to modify parameter every time a new range of data is required and then publish the report. 

 

I was looking for similar implementation in service side but no success so far.

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (2,065)