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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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 dataSample dataIntended resultsIntended results

1 ACCEPTED SOLUTION
AlB
Super User
Super User

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 

 

SU18_powerbi_badge

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please let us know if the expression @AlB provided is helpful.

 

If it is, please accept his reply as solution to your question so that people who may have the same question can get the solution directly.

 

If not, please give us more details.

 

 

Best Regards,

Icey

AlB
Super User
Super User

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 

 

SU18_powerbi_badge

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors