Forum Discussion
Anonymous
7 years agoNot applicable
using Contains and multiple conditions with OR
I have below formula and I have tried DAX contains and search functions, nothing is giving desired output, please suggest. Job Category = IF contains([Job Group],'Materials Management') OR co...
- 7 years ago
Hi Shilpi,
I tested it and this should be working fine.
Do let me know if you need further explanation for this;
Category = SWITCH(TRUE(), IF(SEARCH("Materials Management", [Job Group], 1, 0) > 0 || SEARCH("Distribution", [Job Group], 1, 0) > 0 || SEARCH("Distribution", [Job Group], 1, 0) > 0 ,TRUE() ,FALSE() ),"Distribution", IF(SEARCH("Procurement", [Job Group], 1, 0) > 0 || SEARCH("Categories", [Job Group], 1, 0) > 0 || SEARCH("Geographic", [Job Group], 1, 0) > 0 || SEARCH("Processes", [Job Group], 1, 0) > 0 ,TRUE() ,FALSE() ),"Procurement and Sourcing", IF(SEARCH("Engineering & Construction", [Job Group], 1, 0) > 0 ,TRUE() ,FALSE() ),"Facilities", "N/A" )
zuheirashraf17
7 years agoAdvocate II
Hi Shilpi,
I tested it and this should be working fine.
Do let me know if you need further explanation for this;
Category = SWITCH(TRUE(),
IF(SEARCH("Materials Management", [Job Group], 1, 0) > 0 || SEARCH("Distribution", [Job Group], 1, 0) > 0 || SEARCH("Distribution", [Job Group], 1, 0) > 0
,TRUE()
,FALSE()
),"Distribution",
IF(SEARCH("Procurement", [Job Group], 1, 0) > 0 || SEARCH("Categories", [Job Group], 1, 0) > 0 || SEARCH("Geographic", [Job Group], 1, 0) > 0 || SEARCH("Processes", [Job Group], 1, 0) > 0
,TRUE()
,FALSE()
),"Procurement and Sourcing",
IF(SEARCH("Engineering & Construction", [Job Group], 1, 0) > 0
,TRUE()
,FALSE()
),"Facilities",
"N/A"
)
Anonymous
7 years agoNot applicable
Thanks, this worked!