Forum Discussion
DTPBI
2 years agoFrequent Visitor
How to filter table where a column has multiple comma delimited values
Hi, Hoping someone can help whether this scenario is possible....and if so how to achieve it. I have a table that has comma seperated values in a single column (see Fruits table in Red below). ...
- 2 years ago
Thanks but this didn't work as expected. When selecting all options it showed all rows when it should only show rows if all options were assigned in the Fruits column (comma seperated) to the row.
However, I have managed to work it out.
TABLES
Measure =
MEASUREVAR selValues = CONCATENATEX(VALUES(Slicer[Fruit]),Slicer[Fruit],", ",Slicer[Fruit],ASC)VAR selCount = COUNTROWS(ALLSELECTED(Slicer[Fruit]))VAR sTableselCount = CALCULATE(COUNTROWS(Table),Table[AssignedCount]=selCount)VAR sTableselValues = CALCULATE(COUNTROWS(Table),Table[Fruits]= selValues)VAR sResults = IF(sTableselCount>0 && sTableselValues >0,1)RETURNIF(NOT ISFILTERED(Slicer[Fruit]),0,sResults)
Add the measure to the table filter as below
Ashish_Mathur
Super User
2 years agoHi,
PBI file attached.
DTPBI
2 years agoFrequent Visitor
Thanks but this didn't work as expected. When selecting all options it showed all rows when it should only show rows if all options were assigned in the Fruits column (comma seperated) to the row.
However, I have managed to work it out.
TABLES
MEASURE
VAR selValues = CONCATENATEX(VALUES(Slicer[Fruit]),Slicer[Fruit],", ",Slicer[Fruit],ASC)
VAR selCount = COUNTROWS(ALLSELECTED(Slicer[Fruit]))
VAR sTableselCount = CALCULATE(COUNTROWS(Table),Table[AssignedCount]=selCount)
VAR sTableselValues = CALCULATE(COUNTROWS(Table),Table[Fruits]= selValues)
VAR sResults = IF(sTableselCount>0 && sTableselValues >0,1)
RETURN
IF(NOT ISFILTERED(Slicer[Fruit]),0,sResults)
Add the measure to the table filter as below