Forum Discussion
domtrump
2 years agoHelper II
Pass parameter from Cell(s)
Is there some way to pass a parameter to PQ from a value in a cell in the spreadsheet? Or prompt the user for values at runtime? Further, I used to use a tool when I worked with DB2 that would tak...
dufoq3
2 years agoCommunity Champion
Hi domtrump,
yes of course. You can import to power query all tables and named ranges. If you want to pass parameter from excel file to power query - just name ist i.e. myParameter
Then right clik on that cell --> Get Data from Table/Range
In Power Query right clik on value and Drill Down
Now you can use your parameter in SQL query but you need to add it like this (imaine dashes as your SQL code) - but maybe you have to use more quotes. Just try it but it works.
----------" & myParameter & "---------------------