Forum Discussion
DAX Count Filtering where a column contains text from another Table's Column
Hi Anonymous
Try this:
1. Place Table2[Fruit] in the rows of a matrix visual
2. Create this measure and palce it in the visual
Measure =
COUNTROWS (
FILTER (
Table1;
CONTAINSSTRING ( Table1[Product]; SELECTEDVALUE ( Table2[Fruits] ) )
)
)
Please mark the question solved when we get to the solution and consider kudoing if posts are helpful.
Cheers ![]()
- Anonymous7 years agoNot applicable
Hello AlB I tried as you instructed but it is only showing the individual values, so it is not counting the fields where I have mixed fruits (cases..1, 6, 7, 9,10)
the output is showing:
Apple 1 Banana 1 Orange 1 Grape 1 - AlB7 years ago
Community Champion
You sure you're doing it as described? I get exactly the results you show in your first post
- Anonymous7 years agoNot applicable
Hello AlB
I tried with the frutis scenario and it worked but in production it didnt work.
I have the following DAX, the only differece with yours are the ";" which were not recognized and I changed them to ","
CountProducto = COUNTROWS ( FILTER ( visitas, CONTAINSSTRING (visitas[Product],SELECTEDVALUE(UCVisitas_ProductoServicio[Title])) ) )Here is a pic of the info that is not working correctly:
A = The result, as you can see, there es an empty "product".
B = The count of the products (without the filter) where you can see an example of the mixed products (line 3).
C = The products catalog.
What I noticed is the result in production also gives me an empty "Category" (A).
Thank you for your help.