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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Aknas
Frequent Visitor

string contains another column flag

Hi - I was looking if this is possible in power bi .Text contains another column.gif

 

 

above is a sample excel file that shows the result ( formula) - Looking similar solution in PB

 

Thanks

2 ACCEPTED SOLUTIONS
PhilipTreacy
Super User
Super User

Hi @Aknas 

 

Download example PBIX file

 

If you want a column try this

 

Flag = IF(CONTAINSSTRING([Full],[Partial]),"Yes","No")

 

 

If you want a measure, try this

Flag Measure = IF(CONTAINSSTRING(SELECTEDVALUE('DataTable'[Full]),SELECTEDVALUE('DataTable'[Partial])),"Yes","No")

 

flags.png

 

If you are happy with a Boolean result for the flag, rather than text, you can just use, e.g.

CONTAINSSTRING(SELECTEDVALUE('DataTable'[Full]),SELECTEDVALUE('DataTable'[Partial]))

 

and it returns True or False, no need for the IF to return "yes" or "no".  This works for both the column and measure.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

Thanks Philip - All worked.

View solution in original post

2 REPLIES 2
PhilipTreacy
Super User
Super User

Hi @Aknas 

 

Download example PBIX file

 

If you want a column try this

 

Flag = IF(CONTAINSSTRING([Full],[Partial]),"Yes","No")

 

 

If you want a measure, try this

Flag Measure = IF(CONTAINSSTRING(SELECTEDVALUE('DataTable'[Full]),SELECTEDVALUE('DataTable'[Partial])),"Yes","No")

 

flags.png

 

If you are happy with a Boolean result for the flag, rather than text, you can just use, e.g.

CONTAINSSTRING(SELECTEDVALUE('DataTable'[Full]),SELECTEDVALUE('DataTable'[Partial]))

 

and it returns True or False, no need for the IF to return "yes" or "no".  This works for both the column and measure.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Thanks Philip - All worked.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.