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 Platform Community / Forums / Power Apps / Calculate % Change Bet...
Power Apps
Answered

Calculate % Change Between 2 Numbers and Require Comment if Outside Tolerance

(0) ShareShare
ReportReport
Posted on by 152

I am trying to develop a 'New' form that reads the 'Previous' entry and calculates the % difference between the value that is entered on the new form to the previous entry.  Based on that calculation, the need is to force a comment on why it is outside the tolerance.

 

I am rather new to PowerApps so at this point i am trying to just get the calculated difference so that I am not too overwhelmed.  In my attached .jpg  i would like to see the '% Diff' label equal to ...  ((555 - 8888) / 8888) * 100 = -93.76 % using a statement in the 'OnChange'  action for the new datacardvalue  ???

 

When i get that I will need to force a comment if the value is greater than like %20.  Hope that is clear enough to understand!

Capture.JPG
Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ghutchinsMicron 

    For the comment, place a label on the screen to display what you want.

    For the Label, simply do the calculation needed based on the values you have:

    With({_enteredValue: IfError(Value(yourDataCardValue.Text), 0)},
     ((yourRecord.columnName - _enteredValue) / _enteredValue ) * 100
    )

    assuming you have some record that you are getting your prior values from (i.e. yourRecord in the above).

     

    Then for the label mentioned above, set the Visible property to:

    IfError(Value(yourCalculatedLabel.Text), 0) > 20

     

    That should provide what you need.

     

    I hope this is helpful for you.

  • ghutchinsMicron Profile Picture
    152 on at

    That was what I needed, thanks.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard