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

If statement from Round function

Hi guys,

 

I wanted to write an If statement based on a Round function that goes Round(Value(LookUp('Details',SessionID=Random,Score)),0) where Value are from a SharePoint list. I want the if statement to display a specific statement based on the score for example, if score=0-3 then display "Low" or if score>=10 then display "Very good".

 

I have tried If(Score.Value < 3, "Low", Score.Value >= 10, "Very good") but received an error. I've been working on solving this for quite a while now and would appreciate if someone can help me.

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User
Super User

@_larissa 

Please consider changing your Formula to the following:

With({_value: Round(Value(LookUp('Details',SessionID=Random,Score)),0)},
   If(_value <3, "Low", 
      _value >=10, "Very Good",
      "So So"
   )
) 

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Jagadeeshk
Responsive Resident
Responsive Resident

It should be,

If(Round(Value(LookUp('Details',SessionID=Random,Score)),0)<3, "low",......... 

 

 

Replace score.value with Round(Value(LookUp('Details',SessionID=Random,Score)),0)

View solution in original post

6 REPLIES 6
RandyHayes
Super User
Super User

@_larissa 

Please consider changing your Formula to the following:

With({_value: Round(Value(LookUp('Details',SessionID=Random,Score)),0)},
   If(_value <3, "Low", 
      _value >=10, "Very Good",
      "So So"
   )
) 

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Jagadeeshk
Responsive Resident
Responsive Resident

It should be,

If(Round(Value(LookUp('Details',SessionID=Random,Score)),0)<3, "low",......... 

 

 

Replace score.value with Round(Value(LookUp('Details',SessionID=Random,Score)),0)

View solution in original post

_larissa
Frequent Visitor

It works!! Thank you 😊

Never knew this would work. Thank you!! 😁

RandyHayes
Super User
Super User

@_larissa 

Yes, you're just looking up the numeric value and (since I hate to type the same formula over and over) it is assigned to a scoped With variable _value in this case.

Then we just use a simple if to look at the _value and return a result.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Yes exactly, it's much more easier that way. Thanks for the new knowledge @RandyHayes 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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
Users online (2,320)