cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sphillips1
Frequent Visitor

Greater Than conditional formating

Hello,

I am new to powerapps and this forum. I have used this are as a resource for a lot of my Powerapps questions. So I decided to reach out to the commuity to see if I can get an answer.

 

Issue
I am trying to get a Datacardvalue box inside a display from to display a red background when the value is not equal to or greater than X value.
I have tried to use a rule to accomplish this but have had no success. Attached are screen shots of the desired results that were achieved by using a powerapp made condition: score_DataCard1.Default = "123"
When I try: score_DataCard1.Default < "123" I get the error "invalid argument type. Expecting a number value". No matter how I try and format the condition I get the same error.
Any help would be great. This would be a cool feature to have for my app but it will not stop my deveploment.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Greater Than conditional formating

One of the issues is that you are trying to use a math operator "<" with a string.  Try adding the following formula to the Fill property of the DataCardValue you want to change colors.

 

If(Value(DataCardValue4.text) < 123, RGBA(255, 0, 0, 1)RGBA(255, 255, 255, 1))

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Greater Than conditional formating

One of the issues is that you are trying to use a math operator "<" with a string.  Try adding the following formula to the Fill property of the DataCardValue you want to change colors.

 

If(Value(DataCardValue4.text) < 123, RGBA(255, 0, 0, 1)RGBA(255, 255, 255, 1))

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Sphillips1
Frequent Visitor

Re: Greater Than conditional formating

Thank you so much! What a great solution! I get so hyper focused on one way of doing things I can't see the other ways to acheive the goal.

Highlighted
Robertjde Helper III
Helper III

Re: Greater Than conditional formating

I have a similar problem and hope you can help me?
I would like to use the IF function to adjust the filling of the label depending on the score.
0-50% = RED, 51-84% = Orange, 85-100% = Green

What should the formula look like?

I would be very grateful for an answer!

Best wishes

virakones Helper I
Helper I

Re: Greater Than conditional formating

@Robertjde 

Bit of a late reply to this, but I figured I'd just post something since I had a similar need.

I think it depends on the control that is feeding your label values but you can try multiple If statements and And for your middle value, it's a bit long but can look like this:

1. I have a Dropdown1 with Items = [10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%]

2. I have a Label1 with Text = Dropdown1.Selected.Value

3. Now Label1 Colour = If(Dropdown1.Selected.Value<50%, Red, If(Dropdown1.Selected.Value>=51% And Dropdown1.Selected.Value<84%, Orange, If(Dropdown1.Selected.Value>=85%, Green)))

You use multiple Ifs here and then an And for the middle value that is 51% or greater but equal or less than 84%.

Hope this helps.

2020-05-29 17-47-16 (1).gif 

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,460)