cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kcornell
Frequent Visitor

If Statement

I'm working on an app that would take a "Reading" value and compare it to a minimum value that is pulled from a Sharepoint list. If the reading value is less than or equal to the minimum value, it returns "Pass" and if the reading value exceeds the minimum value it returns "Fail". I'm having difficulty writing the formula in the Pass / Fail field. 

 

Example:

Reading

-1.00

 

Minimum

-0.002

 

Pass / Fail

Pass

2 ACCEPTED SOLUTIONS

Accepted Solutions
KrishnaV
Super User III
Super User III

Hi @kcornell ,

 

try this,

If(Value(reading)<=Value(minumum),"Pass","Fail")

 
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

After trying myself I was able to get the following formula to work for me with the Negative / Positive. 

 

If(Negative/Positive.Text = "Positive",If(Value(Reading.Text)>=Value(Minimum.Text),"Pass","Fail"),If(Value(Reading.Text)<=Value(Minimum.Text),"Pass","Fail"))

View solution in original post

6 REPLIES 6
KrishnaV
Super User III
Super User III

Hi @kcornell ,

 

try this,

If(Value(reading)<=Value(minumum),"Pass","Fail")

 
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

mdevaney
Super User III
Super User III

@kcornell 

The basic IF statement is written like this...

If(-1.00 <= -0.002, "Pass", "Fail")


If you need help retrieving the value from SharePoint you'll have to share more info about where it is being stored.

 

---
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."

@mdevaney , right, but the issue I was having while I was trying setting this up was that it kept looking at the value as text and not as a number. Using Value() prior to the number helped with this issue. I tried changing the text format from TextFormat.Text to TextFormat.Value and was still getting an error. I appreciate the assistance!

@KrishnaV 

Additional question, if I wanted it to look at a text value, Positive or Negative before it applies this formula, how would I write the new formula? This is because the less-than sign would change to greater-than for positive values. 

 

Annotation 2020-07-07 090237.jpg

After trying myself I was able to get the following formula to work for me with the Negative / Positive. 

 

If(Negative/Positive.Text = "Positive",If(Value(Reading.Text)>=Value(Minimum.Text),"Pass","Fail"),If(Value(Reading.Text)<=Value(Minimum.Text),"Pass","Fail"))

View solution in original post

Hi @kcornell ,

 

Sincere apologies for not able to help you on time, I was completely arrested with my work today!

 

I am really happy that you were able to make it.

 

Regards,

Krishna


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,155)