Forum Discussion
DirectQuery Not Updating with Parameter Change
My understanding is that a parameter can only be bound to one column at a time, and vice versa.
- ashukla23 years agoRegular VisitorSpoilerYes, I have that each parameter is only bound to one column. I am using the same column/parameter value in mulitple queries. Here is sample of my M queries, the only difference in the queries is the bolded parts:
Query 1:
letstr = if Text.Length(test_param) > 0
then " WHERE table1.col1= '" &test_param& "'"
else "",
Source = Value.NativeQuery(PostgreSQL.Database("localhost", "database"),
"SELECT table2.col2#(lf)
FROM table2#(lf)
INNER JOIN table3 ON table2.col3= table3.col3#(lf)
INNER JOIN table1 ON table1.col1= rates.col1#(lf)
"&str&" #(lf)
GROUP BY table2.col2, null, [EnableFolding=true])
in
Source
Query 2:
letstr = if Text.Length(test_param) > 0
then " WHERE table1.col1= '" &test_param& "'"
else "",
Source = Value.NativeQuery(PostgreSQL.Database("localhost", "database"),
"SELECT table1.col4#(lf)
FROM table2#(lf)
INNER JOIN table3 ON table2.col3= table3.col3#(lf)
INNER JOIN table1 ON table1.col1= rates.col1#(lf)
"&str&" #(lf)
GROUP BY table1.col4, null, [EnableFolding=true])
in
Source
When I change the value of test_param, only the table connected to Query 1 updates, the table for Query 2 does not.- lbendlin3 years agoSuper User
Please validate your SQL queries and their joins. You seem to do crossjoins with the rates table and with table1.