cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Danny_L
Helper III
Helper III

Conditional Formatting based on Percentage Value

Hey all,

 

I have a Field that is View Percentage in an Edit Form and I wanted to have the fill color be Red if it is less than or equal to 50%, Yellow if it is between 51% and 75% and Green if it is greater than or equal to 76%. 

 

In trying to test just the first part, the value in the field currently is 80% and I have this in the fill property:

 

(If(ThisItem.CurrentYieldPercentage<= Value("50%"), Red,Blue))

 

It changes the fill color to Red which wouldn't satisfy the formula. 

 

This is what is in the text portion of the field:

 

Round(((Parent.Default - Parent.Min) / (Parent.Max - Parent.Min)) * 100, 2) & "%" (This was there when the field was added)

 

Anyone have any clue how to accomplish this? 

 

Thanks!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Danny_L 

Change your Fill property to the following:

If(Value(Self.Text) > .75, Green,
   Value(Self.Text) > .5, Yellow,   
   Red
)

 

That should give you what you want.

 

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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

3 REPLIES 3
RandyHayes
Super User
Super User

@Danny_L 

Change your Fill property to the following:

If(Value(Self.Text) > .75, Green,
   Value(Self.Text) > .5, Yellow,   
   Red
)

 

That should give you what you want.

 

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
gabibalaban
Dual Super User
Dual Super User

Hi @Danny_L ,

 

If your CurrentYieldPercentage is a number column, I think that's wise to correct your formula as:

If(ThisItem.CurrentYieldPercentage <= 0.5, Red,
    ThisItem.CurrentYieldPercentage > 0.5 && ThisItem.CurrentYieldPercentage <= 0.75,Yellow,
    Red
)

The text property value doesn't affect the color property (or maybe I don't get correctly the hole imagine).

 

Hope it helps !

Thanks @RandyHayes . I think I need to put you on retainer, haha. Again appreciate it

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,471)