Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Solved! Go to Solution.
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] )
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.
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.
Thank you for your answer @v-frfei-msft
It is an interresting way to solve the problem. But i am trying to avoid using a slicer.
@Mariusz Thank you for your anwser it was just what i was looking for. I appreciate that you gave an example with both a measure and a coulmn.
Not to be rude but is there a way to filter the other way around so that it excludes a tag instead of only searching for one tag?
I need to use it the other way around in another report.
Again thank you for your answers.
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] )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
77 | |
68 | |
54 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |