Forum Discussion
How to Reference Parameter in ODBC Query
- 6 years ago
Anonymous ,
Refer if this can help: https://www.biinsight.com/power-bi-desktop-query-parameters-part-1/
Anonymous ,
Refer if this can help: https://www.biinsight.com/power-bi-desktop-query-parameters-part-1/
Hi
Thanks for the quick reply. Using the link you suggested I amended the advanced editor to:
let
Source = Odbc.Query("dsn=DW", "SELECT * FROM mwrdw.dbo.as_sales WHERE fiscyear >= "&Parameter1&" ")
in
Source
However I now get the following error:
Expression.Error: We cannot apply operator & to types Text and Number.
Details:
Operator=&
Left=SELECT * FROM mwrdw.dbo.as_sales WHERE fiscyear >=
Right=2020
I don't know what that means..?
- amitchandak6 years agoSuper User
You are passing as text parameter, it needs number
- Anonymous6 years agoNot applicable
That solved it! When I put '2020' in the parameter it worked - thanks!