Forum Discussion
Slicer-Bound Parameter DirectQuery
- 1 year ago
let
source = Sql.Database("foo.bar.com", "wh",[Query="SELECT * FROM [tfm].[so.input.budget/forecast] WHERE pk = " & Text.From(#"snapshot_pk")])
in
source
This is pretty close to what I started with, I might be glossing over something important
I changed the query to
let
var_snapshot_pk = #"snapshot_pk",
source = Sql.Database("foo.bar.com", "wh"),
ret = Value.NativeQuery(
source
, "SELECT * FROM [wh].[tfm].[so.input.budget/forecast] WHERE pk = @snapshot_pk"
, [snapshot_pk=var_snapshot_pk]
)
in
ret
Here is what my parameter looks like, maybe something is wrong here:
- lbendlin1 year ago
Super User
let
source = Sql.Database("foo.bar.com", "wh",[Query="SELECT * FROM [tfm].[so.input.budget/forecast] WHERE pk = " & Text.From(#"snapshot_pk")])
in
source- Anonymous1 year agoNot applicable
That is pulling the values I expect! Thank you!
I will see a performace improvement by using value.nativequery though, for folding. Is that right?- lbendlin1 year ago
Super User
no. It's already a "native" query when you put it there.