Forum Discussion
amineregask
5 years agoNew Member
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 ...
- Anonymous5 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])))
Anonymous
5 years agoNot applicable
let
Country2 = Table2[Text],
NewTable = Table1,
Counts = Table.AddColumn(NewTable, "Total", each List.Count(List.FindText(Country2, [Text]))
in counts
--Nate