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 need something like:
if Text.Contains([Case Subject], "Word1", "Word2", "Word3", "Word4") or not Text.Contains([Case Subject], "Word5", "Word6") then 1 else 0)
I basically need an OR function here, and the goal is to basically add up the 1s when it comes to my visualisation. Can someone else?
Solved! Go to Solution.
Hi @millie23,
Give this function a go
(string as text) =>
if List.Count( Splitter.SplitTextByAnyDelimiter({"Word1", "Word2", "Word3", "Word4"})(string)) >1
or List.Count( Splitter.SplitTextByAnyDelimiter({"Word5", "Word6"})(string)) =1
then 1
else 0
Here's an example of how to implement that into your own code
let
fxContains = (string as text) =>
if List.Count( Splitter.SplitTextByAnyDelimiter({"Word1", "Word2", "Word3", "Word4"})(string)) >1
or List.Count( Splitter.SplitTextByAnyDelimiter({"Word5", "Word6"})(string)) =1
then 1
else 0,
myTable = #table({"Text"}, {{"Word1Up"}, {"2Word5"}, {"Fish"}}),
AddCondition = Table.AddColumn( myTable, "test", each fxContains([Text]))
in
AddCondition
Here's the output of that final query
I hope this is helpful
Hi @millie23,
Give this function a go
(string as text) =>
if List.Count( Splitter.SplitTextByAnyDelimiter({"Word1", "Word2", "Word3", "Word4"})(string)) >1
or List.Count( Splitter.SplitTextByAnyDelimiter({"Word5", "Word6"})(string)) =1
then 1
else 0
Here's an example of how to implement that into your own code
let
fxContains = (string as text) =>
if List.Count( Splitter.SplitTextByAnyDelimiter({"Word1", "Word2", "Word3", "Word4"})(string)) >1
or List.Count( Splitter.SplitTextByAnyDelimiter({"Word5", "Word6"})(string)) =1
then 1
else 0,
myTable = #table({"Text"}, {{"Word1Up"}, {"2Word5"}, {"Fish"}}),
AddCondition = Table.AddColumn( myTable, "test", each fxContains([Text]))
in
AddCondition
Here's the output of that final query
I hope this is helpful
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.