[SIZE=1]let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Added Custom" = Table.AddColumn(Source, "Custom", each Table1),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Ref No", "Item 1", "Item 2"}, {"Ref No", "Item 1", "Item 2"}),
#"Added Conditional Column" = Table.AddColumn(#"Expanded Custom", "Output", each if [Input] = [Item 1] then [Item 2] else if [Input] = [Item 2] then [Item 1] else null),
#"Removed Other Columns" = Table.SelectColumns(#"Added Conditional Column",{"Output"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Other Columns", each ([Output] <> null))
in
#"Filtered Rows"[/SIZE]