Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm trying to use a 'contains' rule in an IF statement but I keep getting an error. The statement needs to be nested within a longer IF statement too!
In English, the part I'm struggling with should mean:
If FILENAME contains 'bounce', return 'bounce: accepted', otherwise return 'other'
Solved! Go to Solution.
@Anonymous -
I found this interesting article https://www.sqlbi.com/articles/from-sql-to-dax-string-comparison/. Some good examples of use as well as performance.
This works in my small sample:
Column = IF ( SEARCH ( "Bounce", Table1[Text], 1, 0 ), "bounce-accepted", "others" )
Proud to be a Super User!
@Anonymous wrote:Didn't work, I'm afraid. It returned all 0 - oddly, if I tried just the search function, then I had the odd column returning 11?!
To double check, Table1[Text] should be the column in which I'm searching for 'bounce'?
IF(SEARCH("bounce",Table1[Text],1,0) = 1,"bounce-Accepted","Others")Thank you for your help!!
Yes. Correct.
I have an issue where, i have a coulmn below, and i want to get rid of hour and minutes from this column, i had tried many option, but nothing seems to work! can anyone help me on this?
Hi @Anonymous
Could you tell me if your problem has been solved? If it is,kindly mark the helpful answer as a solution if you feel that makes sense.
Regards,
Cherie
@Anonymous -
I found this interesting article https://www.sqlbi.com/articles/from-sql-to-dax-string-comparison/. Some good examples of use as well as performance.
This works in my small sample:
Column = IF ( SEARCH ( "Bounce", Table1[Text], 1, 0 ), "bounce-accepted", "others" )
Proud to be a Super User!
Try this
Column = IF(SEARCH("bounce",Table1[Text],1,0) = 1,"bounce-Accepted","Others")
Didn't work, I'm afraid. It returned all 0 - oddly, if I tried just the search function, then I had the odd column returning 11?!
To double check, Table1[Text] should be the column in which I'm searching for 'bounce'?
IF(SEARCH("bounce",Table1[Text],1,0) = 1,"bounce-Accepted","Others")
Thank you for your help!!
@Anonymous wrote:Didn't work, I'm afraid. It returned all 0 - oddly, if I tried just the search function, then I had the odd column returning 11?!
To double check, Table1[Text] should be the column in which I'm searching for 'bounce'?
IF(SEARCH("bounce",Table1[Text],1,0) = 1,"bounce-Accepted","Others")Thank you for your help!!
Yes. Correct.
This works!!! Thank you!
One more question if it's easy. I meant to put if the text contains "Phase 3" instead of Equals.
Is this easy to add?
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |