Count if with list

expressions
(fabio pedone) #1

Hi , i have a column tipe LIST , where in each cell can be stored a list of value ( enum-list) that refers to another table

i need to count in that column how many times a certain value ([value-to-check]) from table2 is present

i have an expression like that
count(select( Table[column], in(table2[value-to-check],Table[column])))

but does not work

(Steve Coile) #2

Where are you attempting to use this expression? I’d guess in a virtual column in table 2?

(fabio pedone) #3

yes, i explain better with photos the problem is that column is enum_list :
Studio_-_Fogli_Google%202 Studio_-_Fogli_Google

(fabio pedone) #4

i try also contains formula , not working

(Steve Coile) #5

Assuming the KEY value can only occur once in any given Materialli column value, you’re actually counting the number of rows in table 2 that have a Materialli column that includes table 1’s KEY column value:

COUNT(FILTER("Table 2", IN([_THISROW].[KEY], [Materialli])))
1 Like
(fabio pedone) #6

Thank You it works good…
my foult to not consider " IN([_THISROW].[KEY], [Materiali])"

1 Like