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.
Hello,
I need to add two conditions to a CONTAINS STRING statement but it's not working. I'd appreciate if somebody can help please
It would look something like this
Solved! Go to Solution.
Hi @Carrhill ,
Try this instead:
Output =
VAR _FindString01 = SEARCH("ABC", [Column1], 1, 0)
VAR _FindString02 = SEARCH("XYZ", [Column2], 1, 0)
RETURN IF(_FindString01 > 0 && _FindString02 > 0, "X", "Y")
Example Output:
@Carrhill , Try like
Column = IF( CONTAINSSTRING('Table '[Column] "A") || CONTAINSSTRING ('Table'[Column] "B") || CONTAINSSTRING ('Table'[Column] "Y")|| CONTAINSSTRING ('Table'[Column] "Z") )
Hey @amitchandak ,
Thank you! You have solved the problem posed. However I wasn't entirely clear in my question.
This is my goal...
If the column 1 contains "abc", and Column 2 contains "xyz", return X, else Y
Is there a way to do this ? Thanks for your help!
Hi @Carrhill ,
Try this instead:
Output =
VAR _FindString01 = SEARCH("ABC", [Column1], 1, 0)
VAR _FindString02 = SEARCH("XYZ", [Column2], 1, 0)
RETURN IF(_FindString01 > 0 && _FindString02 > 0, "X", "Y")
Example Output:
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 |
|---|---|
| 26 | |
| 25 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 42 | |
| 41 | |
| 40 | |
| 21 | |
| 20 |