Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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 frequent behavior recognized. I want to return classes that has rank 1 and in case there are different classes with rank 1, assign label = 'behavior not yet recognized'. If the rank > 1, label = blank.
| Customer ID | Class | Rank | Label |
| 1265 | move to A | 1 | Behavior not Yet Recognized |
| 1265 | move to A | 1 | Behavior not Yet Recognized |
| 3489 | move to B | 1 | move to B |
| 1265 | move to C | 3 | |
Solved! Go to Solution.
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()
)
Thank you so much for your kind response@Idrissshatila
Maybe let me rephrase my question. I have some customers in the table who happen to have say two frequent classes that have the same rank of 1. If the customer has rank =1 then return the corresponding class. However, if the customer has two or more classes that have the same rank I want to assign them " behavior not yet recognized". Otherwise if class has rank =1 and other classes have rank >1 then return class with rank =1.
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
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".
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()
)
i think a simple if measure will solve your issue
Measure =
IF(MAX('Table'[Rank]) = 1 , "Behavior Not yet Recognized")
while in a calculated column
Measure =
IF('Table'[Rank] = 1 , "Behavior Not yet Recognized")
Hello @Mncedi ,
if you mean you want a dax measure that you can add on a calculated column then use the following:
Label = if ( 'YourTableName'[Rank] = 1,"behavior not yet recognized",if ( 'YourTableName'[Rank] > 1,
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Proud to be a Super User! | |
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 52 | |
| 45 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 108 | |
| 108 | |
| 39 | |
| 33 | |
| 25 |