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 THEN IF in advanced query editor

Hi,

 

I'd like to create a column similiar to this Excel-column in Advanced Query Editor:

CP REAL =IF([@[CP Raw]]>30;IF(H6368<=20;30;CA6368);CA6368)

 

The conditional column only allows me to create if X Then Y Else Q statements. But i'd like to create a

IF THEN IF ELSE ELSE statement.

 

How do I do this in Advanced Query Editor? Please note that, for various reasons, I don't want to create this column after i've applied my data to my report.

1 ACCEPTED SOLUTION

Hi @Anonymous 

Please see the below

image.png

 

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6

If something>x then do something else (if somethingdifferent then whatever else theend)



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Anonymous
Not applicable

Hi @MattAllington@Mariusz 

 

Thanks for your reply! Almost there. But what I want him to do is basically this:

THEN IF IF.png

 

So skip the first THEN and go straight into the else "if" statement.

Hi @Anonymous 

 

Wouldn't the below give you a desired outcome?

 

image.png

 

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi not really.

 

Basically what it says is: When BARGE_CP_RAW is greater than 30, use BARGE_CP_RAW, but not if TotalMoves is less then 20. Then use "30".

 

Your suggestion says: When BARGE_CP_RAW greater than 30 and TotalMoves is less than 20, then 30.

Hi @Anonymous 

Please see the below

image.png

 

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Please see the below.

 

image.png

 

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.