March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
Trying to condense down a formula where I need to search for multiple values in a column then output one of two outcomes, its working fine with many nested if(search( functions however I wanted to see if I could use double pipe operators to get it a bit tidier, is there a simple way to do so, the below code is giving me the error "cannot convert type text to true/false":
Solved! Go to Solution.
@Anonymous
You can try this measure:
Formula =
SWITCH(
TRUE(),
NOT ISEMPTY(INTERSECT({"a","b","c","d","e"},VALUES('Table'[Column1]))), "Outcome1",
NOT ISEMPTY(INTERSECT({"f","g"},VALUES('Table'[Column1]))), "Outcome2",
"No Outcome"
)
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Anonymous
You can try this measure:
Formula =
SWITCH(
TRUE(),
NOT ISEMPTY(INTERSECT({"a","b","c","d","e"},VALUES('Table'[Column1]))), "Outcome1",
NOT ISEMPTY(INTERSECT({"f","g"},VALUES('Table'[Column1]))), "Outcome2",
"No Outcome"
)
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
That works great thanks.
@Anonymous
Great, you can accept it as a solution as well.
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Formula =
SWITCH (
TRUE (),
COUNTROWS (
FILTER ( { "a", "b", "c", "d", "e" }, SEARCH ( [Value], Table1[col1],, 0 ) > 0 )
) > 0, "outcome1",
COUNTROWS ( FILTER ( { "f", "g" }, SEARCH ( [Value], Table1[col1],, 0 ) > 0 ) ) > 0, "outcome2",
""
)
Please mark the resolved question when you are finished and consider giving a thumbs up if the posts are useful.
Contact me privately for assistance with any large-scale BI needs, tutoring, etc.
Bless you
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |