Reputation: 101
I am new to power query and have been trying you use a cell value as a parameter in the where clause of my SQL query. Following the instructions here on how to reference the value of a cell in a power query I have been able to implement GetValue which when called will return a valid result. In my case, the result is an address string i.e. 1/3 Smith Street. However when I try to use this in filtered Rows (what my searching pointed to as the solution) I get the following error:
DataFormat.Error: The supplied file path must be a valid absolute path. Details: 1/3 - 3/3 Smith Street
I have tried CurrentWorkbook instead of Workbook. My searching yielded mainly references to url references.
The error is from the below line as if I manually type the function result then it works. I have also tried putting the function in Text.From() but didn't help.
#"Filtered Rows" = Table.SelectRows(Source, each [GroupName] = Excel.Workbook(File.Contents(GetValue("pCurrentGroup"))))
I think I am missing something simple as the linked article was selected as correct.
Upvotes: 0
Views: 3681
Reputation: 101
Gahh as soon as I posted I thought of something new to try.. After removing everything except for the function it works! The functioning code is as follows:
#"Filtered Rows" = Table.SelectRows(Source, each [GroupName] = GetValue("pCurrentGroup"))
I guess I was following the instructions too blindly.
Upvotes: 0