Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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:
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
86 | |
84 | |
83 | |
67 | |
49 |
User | Count |
---|---|
131 | |
111 | |
96 | |
71 | |
67 |