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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
MattAllington
Community Champion
Community Champion

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.
I will not give you bad advice, even if you unknowingly ask for it.
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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors