Forum Discussion
Mncedi
3 years agoRegular Visitor
Customer segmentation
I have a dataset that has customer classifications based on recognized behavior. The most frequent behave is ranked 1. Some customers have a rank of 1 in two different classifications, meaning same f...
- 3 years ago
something like this?
Label 1 = VAR _c = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Rank],'Table'[Customer ID])) RETURN SWITCH( TRUE(), AND( 'Table'[Rank] = 1 , _c >1) , "Behavior Not Recogonized" , AND('Table'[Rank] = 1 , _c = 1) , 'Table'[Class], BLANK() )
eliasayyy
3 years agoMemorable Member
thank you for clarifying please try
for measure
Label =
VAR _c = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Class],'Table'[Rank]))
RETURN
SWITCH(
TRUE(),
AND( MAX('Table'[Rank]) = 1 , _c >1) , "Behavior Not Recogonized" ,
AND(MAX('Table'[Rank]) = 1 , _c = 1) , MAX('Table'[Class]),
BLANK()
)
for calculated column
Label 1 =
VAR _c = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Class],'Table'[Rank]))
RETURN
SWITCH(
TRUE(),
AND( 'Table'[Rank] = 1 , _c >1) , "Behavior Not Recogonized" ,
AND('Table'[Rank] = 1 , _c = 1) , 'Table'[Class],
BLANK()
)
please leave a thumbs up if i helped you solve your question
Mncedi
3 years agoRegular Visitor
Thanks once again.
Sorry, I made a mistake, the customer has different classes of the same rank of 1.
| CustID | Class | Rank |
| 33445 | Move to A | 1 |
| 33445 | Move to B | 1 |
| 45657 | Move to B | 1 |
I want to assign a calculated column or measure that will return for me the class when the rank is 1. For customers like the one of ID 33445, that have the same rank of 1 but have different classes, return "behavior not recognized".