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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
adamsumm
Frequent Visitor

IF and Search Function for finding if a specific value exists in two columns

Hello,

 

Very new to Power Bi so I am still trying to figure out how to complete some of the basics.  I am attempting to create a new comlumn that will print either "Personal" or "Company" when searching the Description column and the Transfered_to.cmdb_ci.  I want the function to print Personal if it finds the keyword personal in either column.  

 

The function below is what I am using but it appears to not be working.  It will only Print Personal if it finds the keyword in teh Description column but not in the other.  

 

personal = IF(
IFERROR(
SEARCH("personal", new_call[description]) || search("personal", new_call[transferred_to.cmdb_ci])
, -1) > -1,
"Personal",
"Company"
)

 

biQuestion1.png

 

 

 

Thank you very much!

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @adamsumm,

 

Please try this formula:

personal =
IF (
    SEARCH ( "personal", new_call[description],, 0 ) > 0
        || SEARCH ( "personal", new_call[Transfered_to.cmdb_ci],, 0 ) > 0,
    "Personal",
    "Company"
)

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @adamsumm,

 

Please try this formula:

personal =
IF (
    SEARCH ( "personal", new_call[description],, 0 ) > 0
        || SEARCH ( "personal", new_call[Transfered_to.cmdb_ci],, 0 ) > 0,
    "Personal",
    "Company"
)

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Perfect! thank you very much for helping out with this.  I am confused about this section of the code "

,, 0 ) > 0"

 I would love to learn so If your able to explain that would be great @v-yulgu-msft

 

Thank you!!!!

Hi @adamsumm,

 

Here is a document introducing the usage of SEARCH function for your reference: SEARCH Function (DAX). It explains each part inside this function.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you! that site will help me out a lot!  

Hi @adamsumm,

 

Would you please kindly mark the corresponding reply as an answer so that it can benefit more community members?

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors