Forum Discussion
Anonymous
7 years agoNot applicable
Simple count but with multiple variables in the column
Hey guys so my issue is that I have a table of lets say 3 counties A, B and C. And another table that has a row a column of "Contries for" but in this table you could have more than one contry listed...
- 7 years ago
Anonymous
Try this MEASURE
Measure = COUNTROWS ( FILTER ( Table2, SEARCH ( SELECTEDVALUE ( Table1[Countries] ), [Countries For], 1, 0 ) > 0 ) )
Anonymous
7 years agoNot applicable
Zubair_Muhammad Mariusz
I realised that the numbers are perfectly correct for each country, but when it does the autosum at the bottom of the table this value is incorrect. Would you know the reason why this is so?
I believe it only sums the number of rows in the original table instead of summing the values of the produced table. Would there be a workaround for this?
Zubair_Muhammad
Community Champion
7 years agoAnonymous
Try this MEASURE
Measure =
IF (
HASONEFILTER ( Table1[Countries] ),
COUNTROWS (
FILTER (
Table2,
SEARCH ( SELECTEDVALUE ( Table1[Countries] ), [Countries For], 1, 0 ) > 0
)
),
SUMX (
VALUES ( Table1[Countries] ),
CALCULATE (
COUNTROWS (
FILTER (
Table2,
SEARCH ( SELECTEDVALUE ( Table1[Countries] ), [Countries For], 1, 0 ) > 0
)
)
)
)
)