Forum Discussion
Anonymous
4 years agoNot applicable
Passing PowerBI Parameter To A Stored Procedure
Hello everyone, I am trying to create parameters within PowerBI so that I can pass the values to the parameters of a stored procedure. This is the code for the procedure, which uses the ...
- 4 years ago
The error tells you exactly what the issue is.
If you want IDs as part of your query string, they need to be in text format. So you have two options
- Define the parameters as text-valued rather than numbers.
- Convert the number to text in your query.
"EXECUTE TestProcWithParameters " & Text.From(CustomerKey) & ", " & Text.From(GeographyKey)
AlexisOlson
Super User
4 years agoThe error tells you exactly what the issue is.
If you want IDs as part of your query string, they need to be in text format. So you have two options
- Define the parameters as text-valued rather than numbers.
- Convert the number to text in your query.
"EXECUTE TestProcWithParameters " & Text.From(CustomerKey) & ", " & Text.From(GeographyKey)
- Anonymous4 years agoNot applicable
Thanks. I actually didn't need to change the parameters. Just adding "Text.From" got it to work. I'll see if I need to change them as I build the visuals.
- AlexisOlson4 years ago
Super User
Sorry if I wasn't clear. I gave two options that you could pick from. You don't need to do both. Just go with whatever makes more sense in your use case.
- Anonymous4 years agoNot applicable
Ah, ok. Not a problem. The other solution may come in handy at some point in the future.