Forum Discussion

AndrewPF's avatar
AndrewPF
Helper V
4 years ago
Solved

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 Reply