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
ErikCR
New Member

Similar values to equal a common value

Hello All, 

First time poster. Slowly learning the power of Power Bi 🙂

I would like to create a custom column that evaluates, say column A, if the value contains "NHP" then have the value equal "NHP". Else, do not change the value that is there already.

 

The table contains values such as NHP +4, NHP Chair, NHP Pole, Etc. All these can be summed up as "NHP"

 

I hope that is clear. I think I may be using poor terminology 😞

 

Thank-Erik

1 ACCEPTED SOLUTION
CGrunberg
Advocate I
Advocate I

Something similar to this should work. It looks for NHP in Column A, no matter the case, and returns NHP if found, otherwise it returns the original value from ColA.

CustomCol = IF(CONTAINSSTRING(UPPER(ColA) "NHP"), "NHP", ColA)

 

 

Let me know if you have any problems with trying this out 🙂 

View solution in original post

4 REPLIES 4
ErikCR
New Member

Awesome. 

Thank you.

I just needed to add a comma between ...(UPPER(ColA) and "NHP") then the formula worked.

Now, I'll see if I can next additional conditions 😉

 

Erik

Arul
Super User
Super User

@ErikCR ,

Open Power query editor and do the following,

1. Go to add column at the top and click conditional column,

Arul_0-1676988589546.png

2. Name your new column and then choose the highlighted placeholder values based on your data,

Arul_1-1676988692283.png

3. In the else placeholder choose the highlighted symbol which means select a column if the above mentioned condition is not matched,

Arul_2-1676988783829.png

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


This is great Arul.

I think it will also make added additional conditions easier.

 

Erik

CGrunberg
Advocate I
Advocate I

Something similar to this should work. It looks for NHP in Column A, no matter the case, and returns NHP if found, otherwise it returns the original value from ColA.

CustomCol = IF(CONTAINSSTRING(UPPER(ColA) "NHP"), "NHP", ColA)

 

 

Let me know if you have any problems with trying this out 🙂 

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.