Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I have a column in a table which contains text. I would like to create another column from this which will show a text (i have 3 text that i want to find) if any of these texts is found in the other column and blank if it doesn't contain any of the 3 texts. I am guessing contain or containstring function should do but not sure how.
Please see example below
Column A Column B
General wear replace part General wear
Contamination oil drop found Contamination
vaccuum clean -
other machine moved other
contamination dropped oil contamination
Solved! Go to Solution.
@kb19270 ,
You are right to use CONTAINSSTRING, but combined with the SWITCH function. Acts very much like a nested IF, but much easier to use and read:
ColumnB = SWITCH(
TRUE(),
CONTAINSSTRING( [Column A], "General wear" ), "General wear",
CONTAINSSTRING( [Column A], "Contamination" ), "Contamination",
CONTAINSSTRING( [Column A], "other" ), "other",
"-" )
Trust you will be able to make this work for you.
Regards,
@kb19270 ,
You are right to use CONTAINSSTRING, but combined with the SWITCH function. Acts very much like a nested IF, but much easier to use and read:
ColumnB = SWITCH(
TRUE(),
CONTAINSSTRING( [Column A], "General wear" ), "General wear",
CONTAINSSTRING( [Column A], "Contamination" ), "Contamination",
CONTAINSSTRING( [Column A], "other" ), "other",
"-" )
Trust you will be able to make this work for you.
Regards,
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 54 | |
| 45 | |
| 38 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 86 | |
| 70 | |
| 38 | |
| 29 | |
| 26 |