This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi all,
I need to create a measure or group (not a calculated column) to create a new Y/N measure based on names in a column. I've tried grouping the names but there are thousands of names in my data set and I would have to scroll forever to add new people to the group.
Essentially, I have a table called Teams and want to search the Name column for specified members and return Y/N
IsInTeam1 = IF(CONTAINSSTRING(Teams[Name] in {"Joe Bloggs", "Jane Smith", "Bob Thompson"}),"Y","N")
I want it as a measure so it's easy enough for my colleague to add/remove a name in the formula bar when something changes.
I am having an issue as when I use the CONTAINSSTRING function I don't get the option to add my table/column?
I feel like this should be a simple one but can't get my head around it!
TIA
Solved! Go to Solution.
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 Team
If 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 @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 Team
If 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" )
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 27 | |
| 26 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 45 | |
| 44 | |
| 41 | |
| 21 | |
| 18 |