# Pull a value from a Cell in a Power Query Filter



## Vaslo (Aug 1, 2015)

Hello experts,

I have the following line in my Power Query script:

= Table.SelectRows(_uniques, each ([PC] = "3730"))

I'd like that 3730 to be a reference to a cell.  The reason for this - I have 5-6 queries that filter by PC, and it would make it easier than going into each query and typing in the new number.

Thanks!


----------



## ImkeF (Aug 1, 2015)

Hi Vaslo,
you can type in the value in the first line of a table ("Table1") with column Name "Parameter", then the following query (also named "PCNo") will return the correct string:

let
    PCNo= Excel.CurrentWorkbook(){[Name="Table1"]}[Content]{0}[Parameter]
 in
    PCNo

(This reads as follows: Adress sth in the current workbook: An element called "Table1" - retrieve its content - take the first line (unfortunately PQ starts counting from 0) - in the column called "Parameter")

You then reference it like this:
= Table.SelectRows(_uniques, each ([PC] = PCNo))  

No ""!

Imke


----------

