Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Check whether a string contains a value from another table

I have as a list (about 900) of values that I am interested in: Genus Table: Genus of interest Metopina Neuroptera Corynoptera … In a separate table, I have free text (lab result...
  • Ashish_Mathur's avatar
    3 years ago

    Hi,

    This M code works

    let
        Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
        #"Added Custom" = Table.AddColumn(Source, "Custom", each List.Contains(Genus[Genus of interest],[freetext],(x as text, y as text)=>Text.Contains(y,x,Comparer.OrdinalIgnoreCase)))
    in
        #"Added Custom"

    Hope this helps.