So here is how far I could get with this
let
Source = Excel.Workbook(File.Contents("C:\Port Inventory.xlsx"), null, true),
#"All in one_Sheet" = Source{[Item="All in one",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(#"All in one_Sheet", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Switch", type text}, {"Port", type text}, {"Name", type text}, {"Column2", type text}, {"Column1", type any}, {"Status", type text}, {"Vlan", type any}, {"Duplex", type text}, {"Speed", type any}, {"Type", type text}, {"Description", type text}, {"Migrated", type text}}),
#"Filtered Rows" = #!"Table.SelectRows(#""Changed Type"", each [Switch] = 'Migration sheet'!D2)"
in
#"Filtered Rows"
I do not know ho to refer a cell of a sheet in the current workbook.
I guess this [Switch] = 'Migration sheet'!D2
needs to the replaced with something else in the third last line
I want to use this query as a source for the data for a drop down list. let's say cell D2 contains the value I want to filter by. This will be used in a Power Query that will be used as List for the drown down options of a cell (E2) that will be adjacent to C2