Forum Discussion
SEARCH function using a dynamic list of find text values
I'm looking a way to filter out rows of a table using SEARCH. Similar to this question I hardcoded the search criteria in previous solutions.
However, I have a new requirement where I have dynamic values to search for.
For example, if a related table has values "cat", "dog", "fish" I want to avoid this:
SEARCH("*cat*", 'Table[AnimalName], -1) >=0 || SEARCH("*dog*", 'Table[AnimalName], -1) >=0 || SEARCH("*fish*", 'Table[AnimalName], -1) >=0
The terms cat, dog, and fish are stored in another table and easily referencable. Is there a way to search a column of values?
Thanks,
Mike
4 Replies
- GilbertQSuper UserHi there
What if you had to use the Slicers or the Filters and then search based on the criteria there?
Here is a blog post explaining how to do this?
https://www.fourmoo.com/2018/08/14/quick-tip-adding-search-to-the-default-slicer-in-my-power-bi-report/ - Ashish_MathurSuper User
Hi,
The RELATED() or LOOKUPVALUE() function should work. To get more specific help, share your data and show the expected result.
- mleeFrequent Visitor
Here is a an example of some data and what I'm trying to accomplish:
Element_Table
ModeId ElementName 1 8 inch window 1 6 inch window 1 Brown chair with casters 1 Bi-fold door black 2 8 inch window 2 7 inch window 2 Orange chair with casters 2 Bi-fold door black 3 8 inch window 3 Bookscase cedar 3 Brown chair with casters 3 Bi-fold door black Search_Table
ModelID Search term 1 wind 1 inch 2 wind 2 inch 2 black 3 case 3 cedar What I need to do is for each ModelId is to count how many matches there are in the Element_Table. For example, for modelId =1 I would search all elements with modelid=1 and any elementname's which contain the word "wind" or "inch". Since the search terms are often just partial words they will need to be wildcard searches.
Mike
- Ashish_MathurSuper User
Hi,
What exact result are you expecting? In which Table should the result appear?