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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello.
I would like to add to a formula to a custom column I have written for changing row values based on another column, but I only want to base it off one value.
Consider that I have two columns. Company and Type
| Company | Type | New Column |
| Publix | NF | CH |
| Walmart | ER | CH |
| Publix | DF | CH |
I currently have this code = if Text.Contains([Company], "Publix", Comparer.OrdinalIgnoreCase) or Text.Contains([Company], "Walmart", Comparer.OrdinalIgnoreCase) then "CH" else [Type]
This would change all the Type to CH in a new column based on that company name.
However, for this example. I would like for only the ones that read NF to switch to CH. I want to keep the ones that say ER the same. Besides ER, I also have 2 other values of Type, take example DF FF, I want these to say the same as well.
So basically, I want my formula to do the same thing it is already doing, except ONLY apply to changing the type of NF in a new column to read CH.
It would look like:
| Company | Type | NEW Column |
| Publix | NF | CH |
| Walmart | ER | ER |
| Publix | DF | DF |
Thank you.
Solved! Go to Solution.
Use this
= if List.Contains({"Publix","Walmart"},[Company], Comparer.OrdinalIgnoreCase) and [Type]="NF" then "CH" else [Type]
👍 It's been a pleasure to help you | Help Hours: 11 AM to 9 PM (UTC+05:30)
How to get your questions answered quickly -- How to provide sample data
Use this
= if List.Contains({"Publix","Walmart"},[Company], Comparer.OrdinalIgnoreCase) and [Type]="NF" then "CH" else [Type]
👍 It's been a pleasure to help you | Help Hours: 11 AM to 9 PM (UTC+05:30)
How to get your questions answered quickly -- How to provide sample data
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 7 | |
| 5 | |
| 5 | |
| 3 |