Forum Discussion
Aknas
3 years agoFrequent Visitor
string contains another column flag
Hi - I was looking if this is possible in power bi . above is a sample excel file that shows the result ( formula) - Looking similar solution in PB Thanks
- 3 years ago
Hi Aknas
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")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
- 3 years ago
Thanks Philip - All worked.
PhilipTreacy
3 years agoSuper User
Hi Aknas
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")
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
Aknas
3 years agoFrequent Visitor
Thanks Philip - All worked.