Search code examples
excelpowerquerym

Referencing a dynamic name in PowerQuery results in an error


I have created a new name (variable) in excel using the Name Manager which is called fPath. The value for the name is =CELL("filename").

Name (variable)

I would like to reference this name as a parameter to the source within a function query. But, when I try to invoke the function within the Power Query Editor, I get an error that it wasn't able to find the name.

When the name refers to a cell within the sheet, this works perfectly but when a name is created without a reference to a cell, it is unable to find it.

Am I correct in assuming that what I'm trying to do is not possible?

EDIT:

Here's the code for for the Function Query where I have defined a parameter which is then used to dynamically get the source of the file.

[query details]

Error Image


Solution

  • Please see this from Ken Puls

    https://www.excelguru.ca/blog/2014/11/26/building-a-parameter-table-for-power-query/