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.
Hi,
I'm trying to createa calculated column that will search [application names] and tag those can contain certain text.
My attempt is below:
operations tag = if(Text.Contains([Application Name], "CIP1" or "ETL" or "OPS", 1) > 0) then "Operations Component" else ""
The error I recieve is as follows:
Expression.Error: We cannot convert the value "CIP1" to type Logical.
Details:
Value=CIP1
Type=Type
I understand the issue here is that I'm mixing boolean logic with a string but whats the best way to go about it?
I realise I could probably use a conditional column instead but I may have ALOT of values to search the database for so it makes sense for me to have it in a function as opposed to a "click click click click" process.
Should I be using another method or have I written the Text.Contains incorrectly?
Solved! Go to Solution.
Hi,
Does this M language formula do the job?
=if Text.Contains([Application Name], "CIP1")=TRUE or Text.Contains([Application Name], "ETL")=TRUE or Text.Contains([Application Name], "OPS")=TRUE then "Operations Component" else null
Hi,
Does this M language formula do the job?
=if Text.Contains([Application Name], "CIP1")=TRUE or Text.Contains([Application Name], "ETL")=TRUE or Text.Contains([Application Name], "OPS")=TRUE then "Operations Component" else null
This is from the example for text.contains
EVALUATE
ROW(
"Case 1", CONTAINSSTRING("abcd", "bc"),
"Case 2", CONTAINSSTRING("abcd", "BC"),
"Case 3", CONTAINSSTRING("abcd", "a*d"),
"Case 4", CONTAINSSTRING("abcd", "ef")
)
You might use something like
if(
OR(
OR(CONTAINSSTRING([Application Name], "CIP1"),CONTAINSSTRING([Application Name],"ETL"),
CONTAINSSTRING([Application Name], "OPS"),
"Operations Component,
"")
Help when you know. Ask when you don't!
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 |
---|---|
115 | |
99 | |
88 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |