Forum Discussion
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
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
Thanks Philip - All worked.
2 Replies
- PhilipTreacySuper 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
- AknasFrequent Visitor
Thanks Philip - All worked.