cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Csmith31
Helper I
Helper I

If Statement Power BI

Looking for a way to include a If statement with multiple conditions into Power BI. Example 

 

If Column B is 2 numbers greater than Column A  be than investigate. otherwise Do Not Investigate. 

 

example of what I am looking to do.

 

A     B       C

1      3      Investigate

2      2      Do Not Investigate

5      6      Do Not Investigate

7      9      Investigate

8      9      Do Not Investigate

1 ACCEPTED SOLUTION
gauravtanwar
Resolver II
Resolver II

Below dax can be used as per your example:

Column =
IF(
B > A + 2,
"Investigate",
"Do Not Investigate"
)

 

You can use nested If statement to have multiple conditions as shown below:

Price Group =
IF(
'Product'[List Price] < 500,
"Low",
IF(
'Product'[List Price] < 1500,
"Medium",
"High"
)
)

 

Hope this helps

View solution in original post

3 REPLIES 3
gauravtanwar
Resolver II
Resolver II

Below dax can be used as per your example:

Column =
IF(
B > A + 2,
"Investigate",
"Do Not Investigate"
)

 

You can use nested If statement to have multiple conditions as shown below:

Price Group =
IF(
'Product'[List Price] < 500,
"Low",
IF(
'Product'[List Price] < 1500,
"Medium",
"High"
)
)

 

Hope this helps

View solution in original post

PaulDBrown
Super User II
Super User II

@Csmith31 

Try:

New measure = 
VAR Diff = SUM('Table'[B]) - SUM('Table'[A])
RETURN
SWITCH(TRUE(),
Diff >= 2, "Investigate",
"Do Not Investigate")

 

Invest.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






RolanRodrigues
Frequent Visitor

You can do this by creating a column and using the following If formula:

C = if(('Table '[b] - 'Table '[a]) = 2, "Investigate", "Do Not Investigate")

Hope this help you 

Have a great day

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors