'Is it possible to do this with Power Query
good afternoon, I have a problem with a query in Power Query, I am making this query to a server and within the code there is a value that must be changing every month (green box (127)). It will be possible to change this value from an Excel cell as a parameter, and that this parameter is part of the code (M language) in Power Query ?
Solution 1:[1]
Put your parameter value into a cell, and assign a named range to this cell - e.g. MyParameter
Now you can reference this named range in your Power Query, and include it in your query string:
MyParameter = Excel.CurrentWorkbook(){[Name="MyParameter"]}[Content]{0}[Column1],
Source = Sql.Database("MyServer", "CAMPANAS", [Query="SELECT * FROM [CAMPANAS].[dbo].[CTO] ct WHERE ct.Refresco = " & Text.From(MyParameter)]),
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Olly |
