Forum Discussion
Anonymous
4 years agoNot applicable
Multiple condition
Hello Dear Community, I hope you are well. I have a small problem. I have created a column that gives me categories based on the content of a cell in another column. Here is the formula : GBU/...
- 4 years ago
Is this better?
GBU/GF = VAR ProdElements = CALCULATETABLE ( VALUES ( Example[Element] ), ALLEXCEPT ( Example, Example[Product_ID] ), Example[Dimension] = "GMC" ) VAR Elements = FILTER ( { "CHC", "SPC", "VAC", "GENMED", "GLOBAL" }, NOT ISEMPTY ( FILTER ( ProdElements, CONTAINSSTRING ( Example[Element], [Value] ) ) ) ) RETURN SWITCH ( TRUE (), COUNTROWS ( Elements ) = 2 && "GLOBAL" IN Elements, EXCEPT ( Elements, { "GLOBAL" } ), COUNTROWS ( Elements ) > 1, "MBC", COUNTROWS ( Elements ) = 1, Elements, "GLOBAL" )
Anonymous
4 years agoNot applicable
here is perhaps a simply view :
the target :
If the product has several elements (other than GLOBAL ex: CHC and SPC ) then Multi
If the product has only one product it keeps its element
We count Global only if product have ONLY GLOBAL (ex : CHC and GLOBAL then we keep CHC)
Thank you
AlexisOlson
4 years agoSuper User
Yes, this is what my logic is doing.
According to your original post, it's also using "GLOBAL" when it doesn't match anything else.