Forum Discussion

amineregask's avatar
amineregask
New Member
5 years ago
Solved

Count number of text cells containing string, for each string in a table column

Hi everyone,   I would need your help on the following case. I have 2 tables: Table 1: contains a column with a list of countries Table 2: contains a column with text elements I would like to ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi amineregask 

     

    You need to remove that "each" after "Custom", before (X)=>

    = Table.AddColumn(#"Changed Type1", "Custom",  (x)=> List.Count(List.Select(Table2[Text], each Text.Contains(_,x[Country]))))

     

    Anonymous the way seems better, but there is a typo, you can try like this

    Table.AddColumn(#"Changed Type1", "Custom", each List.Count(List.FindText(Table2[Text],[Country])))