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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Measure that searches for any number of selected substrings

Currently I have a two tables, Sales and Keywords

 

Sales Table

Id | Value | Keywords

-------------------------------

0 |  100    | Fish, Meat, Dairy

0 |  50      | Fish, Fresh

0 |  25      | Fresh, Frozen

 

Keywords Table

Keyword |

----------------

Fish

Fresh

Meat

Dairy

Frozen

 

Id like display sales depending on a selected, or several selected keywords

So with a filter visual if i select Frozen and Fresh i would like to see these sales:

0 |  50      | Fish, Fresh

0 |  25      | Fresh, Frozen

As they each have at least one match.

 

Currently I have implemented a measure which allows me to do this for a single selected value:

Measure = 
    SEARCH (
        SELECTEDVALUE('Keywords'[Keyword]),
        SELECTEDVALUE('Sales'[Keywords]),
        ,
        -1
    )

I can then filter by the result of this measure being > 0 and will receive the results I desire. When multiple values are selected in the filter visual this no longer works(because of SELECTEDVALUE?)

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Take out the keyword column from the first table. In power query create a new table using that table.

refer if needed

https://www.youtube.com/watch?v=kU2M1LmNvNo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=2

https://www.youtube.com/watch?v=vHuhbvYCiNc&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=3

 

Then duplicate the column and split the second column based on comma and then it will combination of column and each keyword. Join the new table with the existing table using many to many bidirectional and use that

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Take out the keyword column from the first table. In power query create a new table using that table.

refer if needed

https://www.youtube.com/watch?v=kU2M1LmNvNo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=2

https://www.youtube.com/watch?v=vHuhbvYCiNc&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=3

 

Then duplicate the column and split the second column based on comma and then it will combination of column and each keyword. Join the new table with the existing table using many to many bidirectional and use that

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks! this works perfectly.

 

Is there a way to solve this with measures though? Afaik it is always preferred to use a measure vs creating extra columns / tables.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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