cancel
Showing results for
Did you mean:
Helper III

how to have text boxes change colour based on value

Hi,

I have a number of drop downs with options 1-5. The numbers in each box are used to calculate a percentage in a text box.

Code below:

'(DataCardValue21.Selected.Value + DataCardValue22.Selected.Value + DataCardValue23.Selected.Value+ DataCardValue24.Selected.Value+ DataCardValue25.Selected.Value) / 25 * 100'

This works!

I am trying to have the percentage box change colour based on what percentage is filled e.g.

<25% : Red

25- 50% : Orange

50-75% : Yellow

75-100% : Green

Can anyone help?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

Select the color or fill property of the textbox and use this formula:

If(Value(DataCardValue22_1.Text)<=25,Red,
If(Value(DataCardValue22_1.Text)>25&&Value(DataCardValue22_1.Text)<50,Orange,
If(Value(DataCardValue22_1.Text)>50&&Value(DataCardValue22_1.Text)<75,Yellow,
If(Value(DataCardValue22_1.Text)>=75,Green
))))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Super User

Select the color or fill property of the textbox and use this formula:

If(Value(DataCardValue22_1.Text)<=25,Red,
If(Value(DataCardValue22_1.Text)>25&&Value(DataCardValue22_1.Text)<50,Orange,
If(Value(DataCardValue22_1.Text)>50&&Value(DataCardValue22_1.Text)<75,Yellow,
If(Value(DataCardValue22_1.Text)>=75,Green
))))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Announcements

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.

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
Top Kudoed Authors
Users online (3,172)