web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Comparing numbers

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm brand new to this, I'm looking to help create a solution that would quickly compare a list of numbers and highlight any numbers that are outside of (+ X, -X)  which would need to be adjusted for each list. I know there are simple formulas in excel but would like to couple this with other tools in power apps. Any suggestions on where to start? 

Categories:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    On button's OnSelect property you can use (minCount and maxCount are minimum and maximum allowable limit)

    If(Value(TextInput1.Text) > maxCount || Value(TextInput1.Text) < minCount, Notify("The number is not in the range"), SubmitForm(Form1))

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @Anonymous in addition to the solution given by @NandiniBhagya20 please find the following:

     

    Power Fx (the language you code in power apps) have a full set of operators and identifiers and can be found at Operators and Identifiers in Microsoft Power Fx - Power Platform | Microsoft Docs

     

    Consider the following:

    You have a list with numbers, let's call the list a SharePoint List myList and this list has a column evalNumber.

     

    Steps to highlight numbers outside of range.

    1. add a textinput and call it txtLowerLimit. set its Format to Number
    2. add a textinput and call it txUpperLimit. set its Format to Number
    3. add a gallery and to it add a label
      1. label Text = Thisitem.evalNumber //display the number in the list
      2. label Color = If(ThisItem.'Is in Range',Green,Red)  //if the number is in range its green else it displays red
    4. set the gallery Items = AddColumns(myList, "Is in Range", And(evalNumber < Value(txtUpperLimit.Text), evalNumber > Value(txtLowerLimit.Text))) 

    Result

    rin range checker.gif

     

    Code in example:

    Gallery Items =

     

    AddColumns(
     ForAll(
     Sequence(5),
     {
     evalNumber: RandBetween(
     -10,
     10
     )
     }
     ),
     "Is in Range",
     And(
     evalNumber < Value(txtUpperLimit.Text),
     evalNumber > Value(txtLowerLimit.Text)
     )
    )

     

     

    Hope it helps,

    R

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard