cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sienna28
Post Patron
Post Patron

How to use And/Or

How can I perform an And/or check behind a button
 
This one works fine
 
If(Value(Blood1.Text) >= 120 && Value(Blood1.Text) <=129  && Value(Blood2.Text) < 80 ,Set(colorset,"#ffff1a");Set(txtval,"ELEVATED"));
 
But what if I want to check two text box values using an and/or calculation?
If textbox1 > 80 and/Or  textbox2 > 120
 
Thanks
13 REPLIES 13

@sienna28 
Brilliant picture.  The logic should look like this

 

If(
    Value(Blood1.Text) < 120 And Value(Blood2.Text) < 80,
    Green,
    (Value(Blood1.Text) >= 120 Value(Blood1.Text) <= 129) And Value(Blood2.Text) < 80,
    Yellow,
    (Value(Blood1.Text) >= 130 Value(Blood1.Text) <= 139) And (Value(Blood2.Text) >= 80 Value(Blood2.Text) <= 89),
    Orange,
    Value(Blood1.Text) >=140 Or Value(Blood2.Text) >= 90,
    RedOrange,
    Value(Blood1.Text) > 180 Or Value(Blood2.Text) > 120,
    Red
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Looks good

Thanks for that.

 

I am finding if I put values in for 

 

181 and 122 then option 4 (Hypertension stage 2) is firing.

I was expecting option 5 (Hypertensive crisis) to display.

 

I think option 4 and 5 look similar

 

@sienna28 

I know what the issue is... I needed to invert the order displayed on the chart when coding it, lol.

If(
    Value(Blood1.Text) > 180 Or Value(Blood2.Text) > 120,
    Red,
    Value(Blood1.Text) >=140 Or Value(Blood2.Text) >= 90,
    RedOrange,
    (Value(Blood1.Text) >= 130 Value(Blood1.Text) <= 139) And (Value(Blood2.Text) >= 80 Value(Blood2.Text) <= 89),
    Orange,
    (Value(Blood1.Text) >= 120 Value(Blood1.Text) <= 129) And Value(Blood2.Text) < 80,
    Yellow,
    Value(Blood1.Text) < 120 And Value(Blood2.Text) < 80,
    Green
)

 

View solution in original post

Excellent - Works well

 

Many thanks

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (1,905)