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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
sfcmartint1985
Regular Visitor

Conditional Column

Hi everyone,

 

Our team is working with Power BI to analyze unstructured data (hot line complaints) and in an effor to trend the data we are using a conditional column to search for key terms within each complaint in an effort to categorize the complaint. Example: Key terms, community, care, town, doctor all result in a conditional column result of 'Community'.  Mostly it works great but is there a way to add multiple key words to the search value?  We have tried separating with a comma, space, etc, but do not get the correct results. Below is a snip of me trying to add mulitple terms which fails. 

sfcmartint1985_0-1690545555007.png

 

2 REPLIES 2
mukeshkasi25
Frequent Visitor

Hi @sfcmartint1985  ,

Here is the screenshot of my workings;
Here I am going to an custom column based on country,
for eg, if the country is UK,Belgium then Europe and
if the country is Spain,Netherlands then WesternEurope

mukeshkasi25_0-1690895326254.png

 



Go to PowerQuery->Add Column(task basr)->CutomColumn

Use this in the custom query formula:
= if List.ContainsAny({[Country]},{"UK","Belgium"}) then "Europe" else

if List.ContainsAny({[Country]}, {"Spain", "Netherlands"}) then "WesterernEurope" else "Other")

 

mukeshkasi25_1-1690895326260.png

 

 

Here is the result:

mukeshkasi25_2-1690895326268.png

 

Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

Insert a conditional column and put following formula

Change Text to your column name

"a", "b"....to your list of values which you are trying to find

if List.ContainsAny({[Text]}, {"a", "b"}, (x,y)=>Text.Contains(x,y)) then "TomTest" else null

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.