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" )
David-Ganor
4 years agoResolver II
Hi Anonymous
You might consider to change the true/false into 1 and 0...
Than instead of switch - just sum it...
Meaning: condition 1 + condition 2...etc...
If it is greater than 1..than MBU...
Other wise - your original formula...
Anonymous
4 years agoNot applicable
Hello David-Ganor
I dont understand your suggestion.
Target is to have a new categories because some users have more than one (ex: Genmed and Vaccin, .. )
If I change my condition like if element contain "CHC" then 1 and same for the other like
Global = O, CHC=1, .. After I make a sum of rows how to determine the new categorie