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 ) )
Zubair_Muhammad
Community Champion
7 years agoAnonymous
Try this MEASURE
Measure =
COUNTROWS (
FILTER (
Table2,
SEARCH ( SELECTEDVALUE ( Table1[Countries] ), [Countries For], 1, 0 ) > 0
)
)
- Anonymous7 years agoNot applicable
Zubair_Muhammad
Thanks for your quick reply but I am still getting the same result, using your formula.- Zubair_Muhammad7 years ago
Community Champion
Anonymous
Please check attached file with your sample data
- Anonymous7 years agoNot applicable
Zubair_Muhammad
After playing around with my relationships it seems your answer is correct iff my two tables are unlinked in my relationship model. However if they are linked I get the same problem. Could you help explain why this is so? As I do not want to create a whole new unlinked redundant table just for this calculation.- Zubair_Muhammad7 years ago
Community Champion
Anonymous
If they are linked somehow, i believe you can use ALL function to remove the FILTER context
Measure = COUNTROWS ( FILTER ( ALL(Table2), SEARCH ( SELECTEDVALUE ( Table1[Countries] ), [Countries For], 1, 0 ) > 0 ) )