web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / I need help with condi...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by 24

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.

Categories:
I have the same question (0)
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    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

  • Verified answer
    GarethPrisk Profile Picture
    2,828 on at

    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.

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    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 Profile Picture
    24 on at

    What box would I put the rounding formula in?

    The text box already has Parent.Default in

     

    Thank you

  • gsd0475 Profile Picture
    24 on at

    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

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    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 Profile Picture
    24 on at

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

     

     

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    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 Profile Picture
    24 on at

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

  • GarethPrisk Profile Picture
    2,828 on at
    Wrap that in a Text() function.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard