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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
VinayakDeb
New Member

Replace value in one cell based on condition on another

Hi,

I'm very new to PowerBI and I need your help. I tried various options including conditional columns, but it doesn't seem to work. They all add extra columns, that I would like to avoid.  

I'm recovering an excel file with two columns "Groupe Description" & "Categorie".

For Groupe Description value "BMW Finance NV" I want to force the category "INSTIT" instead of  default "CORPOR"

All other rows remain untouched. 

 

I tried the code below that I found on this website elsewhere, but it doesn't help.

 

#"Replaced Value" = Table.ReplaceValue(#"Changed Type",each [Categorie],each if [Groupe Description]= "BMW FINANCE NV" and [Categorie]="CORPOR" then "INSTIT" else [Categorie],Replacer.ReplaceText,{"Categorie"})

 

Please see the below image. 

 

PowerBi Question.jpg

 

Thanks in advance for any help you can provide. 

Regards,

Vinayak

 

1 REPLY 1
PauMargarit
New Member

There are several things that you can try.

1. Click over 'CORPOR' AND 'BMW FINANCE NV' and select the text in order to check that you don't have spaces at the end of your text. (if you have spaces remember that you can trim the columns)

2. You could try to use Replacer.ReplaceValue instead of Replacer.ReplaceText.

3. If it doesn't work, you could try to change types and use both replaces again.

4. If nothing works, you could try to use Text.Contains([Categorie], "CORPOR").

 

I've noticed that the name of the column is in capital letters but it's not in the formula. I supose because it's an example.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Kudoed Authors