cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Search a string in other column in same row

Hi,

I would like to compare 2 columns (same Row)'s value, if one contains the other, return Y.

 

Result = if( CONTAINSSTRING(Table[Column_A], Table[Column_B]), "Y", "N").
 
But Column A has the strings like , "Xyz 19A, Xyx 19B". Column B has the string "Xyx 19".
 
Expected result is:
Column A / Column B / Result
Xyz19A, Xyx19 / Xyz19 / Y
Xyz19A / Xyz19 / N
 
But my current implementation results in:
Column A / Column B / Result
"Xyz19A, Xyx19" / "Xyz19" / Y
"Xyz19A" / "Xyz19" / Y
Can anyone help how to solve it?
1 REPLY 1
Highlighted
Super User V
Super User V

Re: Search a string in other column in same row

Hi @e2liu77 ,

 

Your requirment is not very clear.

 

CONTAINSSTRING ( <WithinText>, <FindText> )

PARAMETER ATTRIBUTES DESCRIPTION

WithinText 

The text in which you want to search for FindText.

FindText 

The text you want to find. You can use the ? and * wildcard characters; use ~? and ~* to find the ? and * characters.

 

This is performing correctly as per your current implementation.

 

Also not very clear if colum B has value Xyz19 or Xyx19.

 

Can you pls share some sample data to understand the scenario better.

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors