cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

3 REPLIES 3
Super User III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Super User II
Super User II

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (81,874)