Forum Discussion
morgtd30
4 years agoHelper I
Multi-Select filtering column checking if it contains multiple pieces of text
I've tried using this solution, but it seems to work on an OR basis https://community.powerbi.com/t5/Desktop/Dynamic-filtering-slicing-if-text-contains/td-p/425504 I'd like to achieve the follow...
MFelix
4 years agoSuper User
Hi morgtd30 ,
I made a similar approach to this on this post:
Making some small adjustment I was abble to reach the following measure:
Find Word Formula_V2 =
// Character that split phrase into words
VAR SplitByCharacter = " "
// Temporary table that splits selected phrase into words
VAR Words_table =
ADDCOLUMNS (
GENERATE (
SELECTCOLUMNS (
ALLSELECTED (Slicer[Slicer] ),
"Find_Text", Slicer[Slicer]
),
VAR TokenCount =
PATHLENGTH ( SUBSTITUTE ( [Find_Text], SplitByCharacter, "|" ) )
RETURN
GENERATESERIES ( 1, TokenCount )
),
"Word", PATHITEM ( SUBSTITUTE ( [Find_Text], SplitByCharacter, "|" ), [Value] )
)
RETURN
IF (
// Function that returns the sum of the values of the words found in the sentance
SUMX (
Words_table,
FIND (
// additonal spaces in the beginning and ending of each word allows to find the exact match, also removed the last "." so that would be specific words
UPPER ( [Word] ) & " ",
UPPER ( SELECTEDVALUE ( 'Table'[Text] ) ) &" ",
,
0
)
) > 0,
1,
BLANK ()
)
See result below and in attach PBIX file:
If you want you can set the measure on the visualization filter pane and set it to non blank values.
- JeBro2 years agoNew Member
Hi,
When only Apples is selected, you expect that the table give 3 rows as a result.no result is showing in the table. But in stead only the row with only apples shows up.