Forum Discussion
Search column and group text
- Anonymous2 years ago
Hi JNelson ,
The CONTAINSSTRING function is designed to handle individual strings, not columns or tables directly.
When using measure, you need to make sure that the function iterates through each row of the table to check the condition for each name.
If you want to learn more about the CONTAINSSTRING function, please see:
CONTAINSSTRING function (DAX) - DAX | Microsoft Learn
Please follow these steps:
1. This is the original data I created:
2. Please try:
IsInTeam1 = CALCULATE( IF( COUNTROWS( FILTER( Teams, CONTAINSSTRING(Teams[Name], "Joe Bloggs") || CONTAINSSTRING(Teams[Name], "Jane Smith") || CONTAINSSTRING(Teams[Name], "Bob Thompson") ) ) > 0, "Y", "N" ) )3. Drag data to the report page for display:
pbix file is attached.
If you have any further questions, please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi,
Instead of measure, create a column through transform data with multiple IF conditions.
for Example :
MemberPresence = IF(
OR( CONTAINSSTRING(Teams[Name], "Member1"),
CONTAINSSTRING(Teams[Name], "Member2"),
CONTAINSSTRING(Teams[Name], "Member3") ),
"Y", "N" )