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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
hushpuppies
Frequent Visitor

How to write the multiple IF statement in PowerBI

Hi there,

 

May I know how to write below multiple IFs statement in my PowerBI query :-

 

IF Actual Cost > 90% of the budget , then "Issue"

IF Actual Cost < 90% and >75% of the budget , then "At Risk"

IF Actuals Cost < 75% of the budget, then "On Forecast"

IF Budget = 0 and Actuals > 15K (20,000 x 75%), then "At Risk"

 

Basically, I would like to have the output of the "Remark" column 

hushpuppies_0-1705127915890.png

 

 

Thank you

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@hushpuppies 

Create your remarks column using DAX as follows. You may add >= where necessary based on your scenario.

Remark = 
SWITCH(
    TRUE(),
    'Table07'[Budget] = 0 && 'Table07'[Actual] > 15000, "At Risk",
    'Table07'[Actual] >= 'Table07'[Budget] * 0.9, "Issue",
    'Table07'[Actual] < 'Table07'[Budget] * 0.9 && 'Table07'[Actual] > 'Table07'[Budget] * 0.75, "At Risk",
    'Table07'[Actual] < 'Table07'[Budget] * 0.75, "On Forecast",
    BLANK()
)

Result:

Fowmy_0-1705131579099.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@hushpuppies 

Create your remarks column using DAX as follows. You may add >= where necessary based on your scenario.

Remark = 
SWITCH(
    TRUE(),
    'Table07'[Budget] = 0 && 'Table07'[Actual] > 15000, "At Risk",
    'Table07'[Actual] >= 'Table07'[Budget] * 0.9, "Issue",
    'Table07'[Actual] < 'Table07'[Budget] * 0.9 && 'Table07'[Actual] > 'Table07'[Budget] * 0.75, "At Risk",
    'Table07'[Actual] < 'Table07'[Budget] * 0.75, "On Forecast",
    BLANK()
)

Result:

Fowmy_0-1705131579099.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

It worked!! 🙂

Thank you @Fowmy

@hushpuppies 

Gald it worked!

Please accept it as a solution.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Ritaf1983
Super User
Super User

Hi @hushpuppies 
with "else" between the statements
Take a look at the linked tutorials:
https://www.youtube.com/watch?v=w57a_XheWz4

https://www.youtube.com/watch?v=o9qAov3kSN4

According to your example if i understood you correctly it will be like this (you can modify the logic if you need).

1. In the first step I added a column of actual % :

Ritaf1983_0-1705135924185.png

2 And then the custom column :

Ritaf1983_1-1705135994985.png

result:

Ritaf1983_2-1705136019502.png

pbix is attached

 

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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