Forum Discussion
Anonymous
6 years agoNot applicable
Filter a value based on a word in a string
Hello Everyone
I am trying to create a mesaure that filters a value based on a word in a text string. The string i build like this "WordA, WordB, WordC, WordD" The word i want to filter is showing up in random places for every row.
I have tried different things and it is not working for me.
Any help is greatly apprenticed.
Hi Anonymous
Please see the below.
Column = IF( SEARCH( "WordC", 'Table'[Text], 1, 0 ) > 0, 'Table'[Value] )Measure = SUMX( FILTER( 'Table', SEARCH( "WordC", 'Table'[Text], 1, 0 ) > 0 ), 'Table'[Value] )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
6 Replies
- Mariusz
Community Champion
- AnonymousNot applicable
Hi Mariusz
Thank you for your answer
and sorry for not being specific enough
Yes i am looking for a specific fixed word every time.
I made a table to better explane it
values that contains WordC get copyed over to a new coulmn.
- v-frfei-msft
Community Support
Hi Anonymous ,
We can make it dynamicly by creating a measure based on a slicer.
Measure = VAR a = SEARCH ( SELECTEDVALUE ( Slicer[Filter] ), MAX ( 'Table'[Text] ),, BLANK () ) RETURN IF ( a = BLANK (), BLANK (), MAX ( 'Table'[Value] ) )PBIX as attached.