Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Lee5150
Helper I
Helper I

Label duplicate values based on another column

Hi all,

 

I have a 'Name' column that contains duplicate values. I'd like a new column that either says "Kitchen" or "Utililty" based on the value in the qty column. The higher number should say "Kitchen", and the lower "Utility".

 

NameQtyCustom Column
ABC10Utility
XYZ30Kitchen
XYZ15Utility
ABC27Kitchen

 

The name column will only ever have 2 of the same entry, never more. So one will always say "Kitchen" and one will always say "Utility", based on the qty column.

 

Can anyone help me achieve this please?

 

Many thanks

1 ACCEPTED SOLUTION
qqqqqwwwweeerrr
Super User
Super User

Hi @Lee5150 

 

I have one quick question so name alway will only two qty or more than that? as per the give data i have created the custom column

You can achive this by create custom colum measure 

custome Column =
var maxvalue = CALCULATE(MAX('Table'[Qty]),FILTER('Table','Table'[Name] = EARLIER('Table'[Name])))
return IF('Table'[Qty] = maxvalue,"Kitchen","Utility")
Here is my output 
qqqqqwwwweeerrr_0-1713335666852.png

Here is my another example hope your all case is covered in this

qqqqqwwwweeerrr_1-1713335864843.png

 

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: www.youtube.com/@Howtosolveprobem

Regards

View solution in original post

4 REPLIES 4
Thennarasu_R
Responsive Resident
Responsive Resident

@Lee5150 

I hope this caluculation will help u to Yours requirements .Better U can use this calculation I'm getting similar output what u required.

rank = var AA=Check[Char]
Var _BB=
RANKX(FILTER(ALL(Check),Check[Char]=EARLIER(Check[Char])),Check[Value],,ASC,Dense)
Return
IF(_BB=1,"Kitchen",IF(_BB=2,"Utility"))



Thennarasu_R_0-1713335899807.png

Thanks ,
Thennarasu 

Did I answer your Question? Mark Accepted as a solution .

Thank you very much!

qqqqqwwwweeerrr
Super User
Super User

Hi @Lee5150 

 

I have one quick question so name alway will only two qty or more than that? as per the give data i have created the custom column

You can achive this by create custom colum measure 

custome Column =
var maxvalue = CALCULATE(MAX('Table'[Qty]),FILTER('Table','Table'[Name] = EARLIER('Table'[Name])))
return IF('Table'[Qty] = maxvalue,"Kitchen","Utility")
Here is my output 
qqqqqwwwweeerrr_0-1713335666852.png

Here is my another example hope your all case is covered in this

qqqqqwwwweeerrr_1-1713335864843.png

 

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: www.youtube.com/@Howtosolveprobem

Regards

This works perfectly! Thank you so much

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.