Pull a value from a Cell in a Power Query Filter

Vaslo

Board Regular
Joined
Jun 3, 2009
Messages
159
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!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,113
Messages
6,176,454
Members
452,728
Latest member
mihael546

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top