cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
gsd0475
Level: Power Up

I need help with conditional formatting (colours) and decimal places

I am very new to power apps (like 12 hours since discovering it), i have created an app with an excel table. it is basically scores against different areas of focus. I need to colour the datacard figures according to the score i.e score greater than 4.1 it shows green or less than 4.1 it shows red. I also need a couple of them reducing to 2 decimal places. I have attached screens shots and any help would be greatly appreciated. I have tried all sorts from on these forums to no avail.

1 ACCEPTED SOLUTION

Accepted Solutions
GarethPrisk
Level: Powered On

Re: I need help with conditional formatting (colours) and decimal places

This would be the Fill property of either the Data Card, or the control within the Data Card, such as a the value control.

If you had a DataCard named DataCard, with the standard 4 controls included DataCardValue, then you could:

  • Set Fill property of DataCard = If(Value(DataCardValue.Text) > 4.1, Green, Red)
  • Set Fill property of DataCardValue = If(Value(DataCardValue.Text) > 4.1, Green, Red)

The Fill expects a valid color property. This includes the built-in colors, an RGBA value, or a ColorValue value.

View solution in original post

12 REPLIES 12
Super User
Super User

Re: I need help with conditional formatting (colours) and decimal places

Hi,
For rounding, you can use the Rounding function. More info here: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-round

For conditional formatting, you can try to set the Color property of the data cards that display the figures.
If(Value(Label1.Text)>4.1, Green, Red)

This is assuming Label1 is where your numbers are. Also, you might want to factor in what happens if the number is exactly 4.1

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com

GarethPrisk
Level: Powered On

Re: I need help with conditional formatting (colours) and decimal places

This would be the Fill property of either the Data Card, or the control within the Data Card, such as a the value control.

If you had a DataCard named DataCard, with the standard 4 controls included DataCardValue, then you could:

  • Set Fill property of DataCard = If(Value(DataCardValue.Text) > 4.1, Green, Red)
  • Set Fill property of DataCardValue = If(Value(DataCardValue.Text) > 4.1, Green, Red)

The Fill expects a valid color property. This includes the built-in colors, an RGBA value, or a ColorValue value.

View solution in original post

WarrenBelz
Level 8

Re: I need help with conditional formatting (colours) and decimal places

Hi @gsd0475 ,

I will call your field StarRating and assume it is a calculated label.

So in the Color properties of StarRating below is an example of the structure only

If(
   Round(Value(StarRating.Text),2) > 4.2, Green,
   Round(Value(StarRating.Text),2) > 3.9, Yellow,
   Round(Value(StarRating.Text),2) > 3.5, Red
)

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

gsd0475
Level: Power Up

Re: I need help with conditional formatting (colours) and decimal places

What box would I put the rounding formula in?

The text box already has Parent.Default in

 

Thank you

gsd0475
Level: Power Up

Re: I need help with conditional formatting (colours) and decimal places

this is what I have.

If(Round(Value(DataCardValue23.Text),2) > 4.10, Green,Red)

The colour formatting works great but i still have this number 3.971123674253.

Any Ideas?

Thank you for all the help so far

Super User
Super User

Re: I need help with conditional formatting (colours) and decimal places

In the text box, where it states Parent.Default.

Add Round(Parent.Default, 2)

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com
gsd0475
Level: Power Up

Re: I need help with conditional formatting (colours) and decimal places

I get "invalid argument type (Text) expecting a Number value instead"

 

 

Super User
Super User

Re: I need help with conditional formatting (colours) and decimal places

Ok. Add
Round(Value(Parent.Default, 2))

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
gsd0475
Level: Power Up

Re: I need help with conditional formatting (colours) and decimal places

Sorry no joy. I have attached a screen shot2020-02-13 (2).png

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,573)