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
P-Lag
Helper I
Helper I

Words in a text string according to a table.

Hi!

 

I need help searching for words in a text string according to a table.

I have used the below DAX expression in a column, and it works, but is it possible to search for words according to another table? I want to avoid to type all words in the expresion.

 

 Product =

SWITCH (

  TRUE (),

  SEARCH ( "ABC", 'Data'[Equipmentlist], 1, 0 ) > 0, "ABC",

  SEARCH ( "EFG", 'Data'[Equipmentlist], 1, 0 ) > 0, "EFG",

  BLANK()

)

 

Example

I have the table “Data” and want to search for words in the column “Equipmentlist” - according to the table “Main Products”, and return the result in the column “Products”.

So, if a word in the “Equipmentlist” match the word in the “Equipment” it will return it to “Products”. I hope I made it clear 😊

Table “Data”

Equipmentlist

Product

ABC, X4569, Y894

ABC

H369, EFG, J789, P678, L789, R896

EFG

XXU, JJP, UUF, P678, L789, R896

UUF

M568, LKE, TTY, PPV. K896,

LKE

J789, P678, ABC, L789, R896

ABC

LKE, TTY, PPV. K896,

LKE

X4569, JJP, UUF, P678,

UUF

 

 

Table "Main Products"

Equipment

ABC

EFG

UUF

LKE

etc…

 

Thanks in advance 😊

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @P-Lag 
Please refer to attached sample file with the soluion

1.png

Product = 
MAXX ( 
    FILTER ( 
        'Main Products',
        CONTAINSSTRING ( Data[Equipmentlist], 'Main Products'[Product] )
    ),
    'Main Products'[Product]
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @P-Lag 
Please refer to attached sample file with the soluion

1.png

Product = 
MAXX ( 
    FILTER ( 
        'Main Products',
        CONTAINSSTRING ( Data[Equipmentlist], 'Main Products'[Product] )
    ),
    'Main Products'[Product]
)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

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.