Forum Discussion
Dynamic filtering/slicing if text contains
- 8 years ago
Hi DennisGaida
May be you could use a MEASURE like
Measure = VAR searchvalue = SEARCH ( SELECTEDVALUE ( Text_Queries[Column1] ), SELECTEDVALUE ( Table1[Text] ), , BLANK () ) RETURN IF ( searchvalue > 0, "Found" )See the attached file. I am not sure if this what you need
Hi DennisGaida
May be you could use a MEASURE like
Measure =
VAR searchvalue =
SEARCH (
SELECTEDVALUE ( Text_Queries[Column1] ),
SELECTEDVALUE ( Table1[Text] ),
,
BLANK ()
)
RETURN
IF ( searchvalue > 0, "Found" )See the attached file. I am not sure if this what you need
This is perfect!
Meanwhile I found this solution: http://blog.pragmaticworks.com/power-bi-problem-design-solution-text-search-slicer which uses an "IsFiltered column:
IsFiltered =
IF(
SUMX('Slicer',
FIND(
'Slicer'[Departments],
MAX('Department Goals'[Affected Departments]),,0)) > 0,
"True",
"False"
)This also works, but is uses an additional Visual Level Filter (IsFiltered) - this in turn doesn't find "all" records if I don't select anything (because IsSelected needs to be true). I added an empty Query_Text to find all elements.
Your solution is a lot cleaner and I love SELECTEDVALUE(), didn't know this existed.
- Anonymous5 years agoNot applicable
Most powerful code is here.
- renaudstaessens5 years ago
Helper I
Anonymous : where is the code David 🙂 there's no hyperlink with the word here
- Anonymous5 years agoNot applicable
renaudstaessens wrote:Anonymous : where is the code David 🙂 there's no hyperlink with the word here
IsFiltered = IF( SUMX('Slicer', FIND( 'Slicer'[Departments], MAX('Department Goals'[Affected Departments]),,0)) > 0, "True", "False" )