Forum Discussion
JJL4677
Jan 30, 2021Copper Contributor
Search Multiple Columns all at once to Find, Locate and return Matching Data Details (Power Query)?
Help please! What is the best, quickest and simplest method? I have a column of [default emails] on one Worksheet1; And three(3) different columns of [email_1], [email_2] and [email_3] on a dif...
JJL4677
Copper Contributor
Hi Sergei, I just tried your script, and it worked!!! but, have a small problem.
It appears that if there are multiple matches, it seems to pick up and return only one(1) of them. Is there a way the Default Email column can return multiple matching emails, if any, by semi-colon, so that all matching emails from each row is included in that one column [Default Email]?
It appears that if there are multiple matches, it seems to pick up and return only one(1) of them. Is there a way the Default Email column can return multiple matching emails, if any, by semi-colon, so that all matching emails from each row is included in that one column [Default Email]?
SergeiBaklan
Feb 09, 2021MVP
When instead of returning first element (assuming it's only one) we return all elements combined as text
let
Source = Excel.CurrentWorkbook(){[Name="Names"]}[Content],
#"Add Default Email" = Table.AddColumn(
Source,
"Default Email",
each
Text.Combine(
try List.Intersect(
{
{[Email_1],[Email_2],[Email_3]},
DefaultEmail[Default Email]
})
otherwise null,
"; "
)
)
in
#"Add Default Email"