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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Assign same value for duplicate entry

Hi,

 

I have a table which has a columns that contains duplicate entries. But there is another column where the values are different.  I want to remove the unwanted values and assign the desired values.

 

In following example; there are some parts with duplicate entries in 'Part' column. But 'Color' column values are different. I want to have a column ('RESULT') where I can show only the valid vaues if the parts are same.

 

PartColorRESULT
Part1RedRed
Part1XYZRed
Part2BlueBlue
Part3ABCNA
Part3 NA
Part4 NA

 

Thanks

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

First, create a dimension table, lets it be named "dimColours". It should be a one column table 

You could either import it or create manually using Enter Data function:

Color
Red
Blue
White

 

Then add in your initial table a column

 

RESULT = 
var _colorPart = FIRSTNONBLANK(SELECTCOLUMNS(FILTER(ALL('Table');'Table'[Part]=EARLIER([Part]) && 'Table'[Color] IN VALUES(ColorTable[Color]));"Color";'Table'[Color]);1)
return
IF(ISBLANK(_colorPart);"NA";_colorPart)

 

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

2 REPLIES 2
az38
Community Champion
Community Champion

Hi @Anonymous 

First, create a dimension table, lets it be named "dimColours". It should be a one column table 

You could either import it or create manually using Enter Data function:

Color
Red
Blue
White

 

Then add in your initial table a column

 

RESULT = 
var _colorPart = FIRSTNONBLANK(SELECTCOLUMNS(FILTER(ALL('Table');'Table'[Part]=EARLIER([Part]) && 'Table'[Color] IN VALUES(ColorTable[Color]));"Color";'Table'[Color]);1)
return
IF(ISBLANK(_colorPart);"NA";_colorPart)

 

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
butlerjay87
Helper I
Helper I

Add a new table (effectively a LOOKUP table).

Then add the correct colours to the parts.

You just need to then set up a 1:Many relationship between the 2 tables on the 'Parts' column.

Please accept solution if this works for you.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.