Forum Discussion
If statement based on another column
- Anonymous5 years ago
Hi perishkabb
You need to add a custom column in Power Query to reflect these conditions and later delete the old column. This way you create a replacement.
Statement should be written like this:
if ([Program Code] = "QI41" or [Program Code]="41IRSA") then "R091-RT"
else if ([Program Code] = "QZ09" or [Program Code]="40IRSA") then "R091-FT"
else [Org Code]I have recreated your case with a small sample. You can find the file in this link.
Hope it helps 🙂
- 5 years ago
Hi perishkabb ,
You could use the following dax to create a new column:
org.codenew = IF('Table'[org.code]="QI41"||'Table'[org.code]="41IRSA","R091-RT",IF('Table'[org.code]="QZ09"||'Table'[org.code]="40IRSA","R091-FT",'Table'[pro.code]))final you will get :
Wish it is helpful for you!
Best Regards
Lucien
Hi perishkabb
You need to add a custom column in Power Query to reflect these conditions and later delete the old column. This way you create a replacement.
Statement should be written like this:
if ([Program Code] = "QI41" or [Program Code]="41IRSA") then "R091-RT"
else if ([Program Code] = "QZ09" or [Program Code]="40IRSA") then "R091-FT"
else [Org Code]
I have recreated your case with a small sample. You can find the file in this link.
Hope it helps 🙂