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 / Calculating Variance o...
Power Apps
Answered

Calculating Variance of two fields

(0) ShareShare
ReportReport
Posted on by 45

Hi...... i have two fields

 

field 1:  Agreed

field 2:  Actual

 

i would like to know how to write the calculation that IF the Actual field has a variance of greater than or equal to 20%, the Actual cell will turn YELLOW.  can someone help me with writing the code in the Actual field?

 

thank you in advance

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @cnorris3570 ,

    Assuming White as the other Colour

    If(
     Abs(Actual - Agreed) / Actual > 0.2,
     Yellow,
     White
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • NurSabrina24 Profile Picture
    165 on at

    Hi, 

     

    I assume you already made a label to calculate the variance.

    In Color properties of field 2, put this:

    If( field2-labelname.Text = "Actual", Yellow, Black ) 

     

    Hope that is what you're trying to find and if it is, please Accept as a solution. 

     

    Thank you.

     

  • cnorris3570 Profile Picture
    45 on at

    i like this sir.....  for my understanding, just curious why you chose Abs versus the VarP?

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    @cnorris3570 ,

    I am probably a bit old-school - Abs() removes any negative element, so -2 and 2 both return 2 (which is what you wanted to show variance either way) and has been around for a long time in many applications.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • cnorris3570 Profile Picture
    45 on at

    thank you sir.  this worked

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 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard