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

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.

Reply
AndrewPF
Helper V
Helper V

if else statement without creating new column

I have a simple IF statement which corrects the value of "Group" for specific instances, for example: 

 

= Table.AddColumn(#"Previous Step", "New Group", each
     if [Name] = "Batman" then "DC"
else if [Name] = "Wonder Woman" then "DC"
else if [Name] = "Iron Man" then "Marvel"
else if [Name] = "Goofy" then "Disney"
else if [Name] = "Mickey Mouse" then "Disney"
else [Group])

 

but the only way I have found of doing this is to create a new column - "New Group". 

 

Is there any way of altering this code so that I alter the value of "Group" instead of adding the new column "New Group"? 

1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

Hi @AndrewPF ,

 

You can try multile replace statements on the Group column rather than trying to create a new column.

You can follow this trick here for creating multiple replacement staements as a SINGLE statement in Power Query:

https://www.youtube.com/watch?v=cOXNbaa_02U

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

1 REPLY 1
Pragati11
Super User
Super User

Hi @AndrewPF ,

 

You can try multile replace statements on the Group column rather than trying to create a new column.

You can follow this trick here for creating multiple replacement staements as a SINGLE statement in Power Query:

https://www.youtube.com/watch?v=cOXNbaa_02U

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.