Forum Discussion
IF & AND formula in power query?
Hi I'm using power query and I would like to use IF & AND statement for the below formula that I had in Excel.
The formula i used in excel to achieve the results is : IF(AND($A2="UK",LEFT($B2,3)="IE0"),$C2*0.86,$C2).
The images here show the sample data as well as the intended results.
Sample dataIntended results
Hi Anonymous
Add a custom column with this code, calling it "Result Actual" (or whatever other name you want):
if [Country]="UK" and Test.Start([Profit Centre], 3) = "IE0" then [Actuals]*0.86 else [Actuals]
You can then remove the original Actuals column
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
2 Replies
- AlB
Community Champion
Hi Anonymous
Add a custom column with this code, calling it "Result Actual" (or whatever other name you want):
if [Country]="UK" and Test.Start([Profit Centre], 3) = "IE0" then [Actuals]*0.86 else [Actuals]
You can then remove the original Actuals column
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers