Forum Discussion
WilliamAzevedo
3 years agoAdvocate II
Filter Table visual based on strings
Hello, everyone. Is it possible to filter rows in a Table visual (or similar) based on text strings, preferably multiple strings? I have the following visual: And I would like this visual ...
- 3 years ago
Hi WilliamAzevedo ,
If your search criteria is constant, you may try the following DAX measure. Anything that is not blank matches any of the text string. Just change the text strings accordingly. Also attached is a sample pbix for your reference.
Filter = VAR CriteriaTable = DATATABLE ( "Criteria", STRING, { { "poca" }, { "santana" }, { "com risco" } } ) RETURN COUNTROWS ( FILTER ( CriteriaTable, SEARCH ( [Criteria], SELECTEDVALUE ( Data[Column2] ), 1, 0 ) ) )
danextian
3 years agoSuper User
Hi WilliamAzevedo ,
If your search criteria is constant, you may try the following DAX measure. Anything that is not blank matches any of the text string. Just change the text strings accordingly. Also attached is a sample pbix for your reference.
Filter =
VAR CriteriaTable =
DATATABLE ( "Criteria", STRING, { { "poca" }, { "santana" }, { "com risco" } } )
RETURN
COUNTROWS (
FILTER (
CriteriaTable,
SEARCH ( [Criteria], SELECTEDVALUE ( Data[Column2] ), 1, 0 )
)
)
WilliamAzevedo
3 years agoAdvocate II
Hi! I tried that and the visual gave me no result. There's how I did it:
Did I do anything wrong? Did I miss anything?