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 August 31st. Request your voucher.

Reply
Havrikahn
Regular Visitor

Matching values in one table, using wildcards, with string values in another table

Excel Example.png

 

I have a large table (Table 1) containing a column with application names. These application names contain version numbers, etc. I would like to simplify this list of application names into groups of predefined strings.

I have created a seperate table (Table 2) with these predefined string values. The plan is to match each row in the application names column with the corresponding simplified string from Table 2. The matching is done by finding the simplified string within the application name.

I managed to create an excel formula for this, but cannot find a way how to use the "reverse wildcard" lookup method in Power BI.

Is this possible to do something similar in Power BI, or do I need to format the data before I pull it into Power BI?

 

 

1 ACCEPTED SOLUTION
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @Havrikahn

 

This calculated column should work.

 

New Column = 
VAR Matches = 
    CALCULATETABLE(
        GENERATE(
            'Table1',
            FILTER(
                Predefined,
                SEARCH(
                    [Apps],
                    [Applications],
                    1,
                    0
                   )
                   >0)
             )
          )
RETURN 
    CONCATENATEX(
        Matches,
        [Apps],",")

image.png

Here is a PBIX file you can download to test.  This will also find and append when it discovers more than one match.

 

https://1drv.ms/u/s!AtDlC2rep7a-oi8WmrfnWoH031de

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

 

This calculated column formula works fine as well

 

=FIRSTNONBLANK(FILTER(VALUES(keywords[Keywords]),SEARCH(keywords[Keywords],Applications[Application],1,0)),1)

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @Havrikahn

 

This calculated column should work.

 

New Column = 
VAR Matches = 
    CALCULATETABLE(
        GENERATE(
            'Table1',
            FILTER(
                Predefined,
                SEARCH(
                    [Apps],
                    [Applications],
                    1,
                    0
                   )
                   >0)
             )
          )
RETURN 
    CONCATENATEX(
        Matches,
        [Apps],",")

image.png

Here is a PBIX file you can download to test.  This will also find and append when it discovers more than one match.

 

https://1drv.ms/u/s!AtDlC2rep7a-oi8WmrfnWoH031de

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Very nice Solution!

Is there a way to filter more fitting matches to the Search?

 

Like I have

Predefined:

"Apple"

"Apple TV"

 

And now in the Applications, I have:

"Apple TV Remote" 

 

It shows me:

"Apple, Apple TV" as match, but I only want the "better" match.

Anonymous
Not applicable

Would you please explain more about your solution, especially why column can be used as first argument of SEARCH?

Thanks.

Anonymous
Not applicable

Hi Hongjyan,

 

It's possible because you're pulling the entire column into the formula when you set the VALUES() term. This means you can also pull a different resultant column, like if you wanted to pull the vendor's name from the Keywords table based on matching the keywords[Keywords] column with Applications[Application] with a minor tweak; setting VALUES() to pull the entire table, then using SELECTCOLUMNS() to choose the field that you want to return:

VendorName = FIRSTNONBLANK(SELECTCOLUMNS(FILTER(VALUES(keywords),SEARCH(keywords[Keywords],Applications[Application],1,0)),"VendorName",[VendorName]),1)

 

Hope this helps,

David

Hi @Phil_Seamark, this solution worked great. Thank you!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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