Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
vishal0soni
Advocate III
Advocate III

Filter / Display rows based on substring present within a slicer

I have a list of items (Apple, Bat, Cherry, Dog, and Elephant).

One or more of these items may or may not appear in the list of multiple comma-separated keywords (Apple, Cherry, Elephant).

What i need to do is to filter out the list of rows having only the selected keyword. So if I select the item "Apple", it should display only the rows having this keyword.

I am able to find out the rows having this item, but not able to display only the identified rows.Slicers for comma-separated valuesSlicers for comma-separated values

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Here, when i click "Apple" in slicer, it shall display only the rows having Apple keyword in the next table.

1 ACCEPTED SOLUTION
vishal0soni
Advocate III
Advocate III

I think I got the easiest way of doing this just by using SEARCH function.

We can write this measure:

Exists = SEARCH(

    SELECTEDVALUE('Products'[Product]),

    SELECTEDVALUE(Solution_Products[SolutionProducts]),

    ,-1)
 
And then use this as a filter criterion for displaying the values. 
It works perfectly fine as desired. 
SlicerforKeywords_Solution.png
 
 

View solution in original post

7 REPLIES 7
vishal0soni
Advocate III
Advocate III

I think I got the easiest way of doing this just by using SEARCH function.

We can write this measure:

Exists = SEARCH(

    SELECTEDVALUE('Products'[Product]),

    SELECTEDVALUE(Solution_Products[SolutionProducts]),

    ,-1)
 
And then use this as a filter criterion for displaying the values. 
It works perfectly fine as desired. 
SlicerforKeywords_Solution.png
 
 
Ritaf1983
Super User
Super User

Hi @vishal0soni 

Please refer to the linked tutorial of @amitchandak :

https://www.youtube.com/watch?v=MKKWeOqFG4c

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Thanks @Ritaf1983 

This looks good and promising. However, there is a challenge, the list of keywords is huge (hundreds of books), and each row has large number of keywords (all nouns in a book).  So making a duplicate column, and then normalizing that entire table would result in huge list I believe.

@vishal0soni Unfortunately I don't think we have another kind of solution, that's necessary to make the relationship...same logic as lookup.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Can we make use of string functions like FIND or SEARCH dynamically to obtain the desired results on the fly?

@vishal0soni I don't see how it can work with the slicers...
but you can try to play with it...

@Ritaf1983 I got it. Used SEARCH function in a measure, and then used that in the filter. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.