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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
xDaniellaM
Regular Visitor

Help with Writing Different IF Statements

Hi all,

 

I'm new to PowerBI and have to write a few IF statements for an assessment I'm doing.

 

1. I need to write an IF statement to determine if a column called 'Cost' has any negative values (<0). Or, if Value<0 is true.

 

2. I need to write another IF statement for a column called 'Profit' to determine if its values are less than those of a column called 'Revenue'. Or, If Profit<Revenue is true.

 

3. Lastly, I need an IF statement to determine if the values in a column called 'Discount' are less than or equal to 1 (<=).

 

I'd appreciate any help.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @xDaniellaM ,

You just need to make a simple modification based on @Idrissshatila formula, please try below dax formula:

 

3- CostIF =
IF ( 'YourTableName'[Discount] <= 1 && 'YourTableName'[Discount] > 0, "True" )

 

 

Best regards,
Community Support Team_Binbin Yu
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

3 REPLIES 3
Anonymous
Not applicable

Hi @xDaniellaM ,

You just need to make a simple modification based on @Idrissshatila formula, please try below dax formula:

 

3- CostIF =
IF ( 'YourTableName'[Discount] <= 1 && 'YourTableName'[Discount] > 0, "True" )

 

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Idrissshatila
Super User
Super User

Hello @xDaniellaM ,

 

1- CostIF =
IF(
'YourTableName'[Cost] < 0,
"True"
)

 

2-

1- ProfitIF =
IF(
'YourTableName'[Profit] <'YourTableName'[Revenue],
"True"
)

 

3- CostIF =
IF(
'YourTableName'[Discount] <= 1,
"True"
)

you could also learn about if statement through this microsoft documentation https://learn.microsoft.com/en-us/dax/if-function-dax

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Thank you for your response.

 

For the third (the Discount), how can I include an AND statement to determine that all values in the column are >0 and <=1?

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.