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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Keep getting stuck on ...
Power Apps
Answered

Keep getting stuck on Conditional Formatting

(0) ShareShare
ReportReport
Posted on by 10

Hi All, 

 

I have what I am sure is an incredibly obvious question but it has had me stumped now for 2 weeks. 

 

I am creating a risk assessment power app and would like to do conditional formatting on the datacard relating to the risk level

 

 -  ❤️ = Green

 -  >3  <6 = Orange

-   >6 = Red

 

I have managed to make this work in the edit screen of the form referring to drop down box selected values: 

JE1_0-1658120851510.png

 If(Max(Right(Text(DataCardValue1),1),Right(Text(DataCardValue4),1),Right(Text(DataCardValue6),1),Right(Text(DataCardValue8),1),Right(Text(DataCardValue12),1))<3, LightGreen, If(Max(Right(Text(DataCardValue1),1),Right(Text(DataCardValue4),1),Right(Text(DataCardValue6),1),Right(Text(DataCardValue8),1),Right(Text(DataCardValue12),1))> 5.9, LightCoral, Orange))

 

 

Where I am stuck is doing conditional formatting in the DetailScreen - I am sure I am referring to the data wrong. 

 

Example- 

 

Here I have a risk assessment done by Stewart. As the Max Residual risk is lower than 3 I would like the datacard to be green. 

 

JE1_1-1658121075395.png

JE1_2-1658121194614.png

JE1_3-1658121213091.png

 

If I use this formula in the fill section: 

If(DataCardValue124 < 3, Green, Red)

 

I get errors- 

JE1_4-1658121309706.png

 

 

I must be referring to the data incorrectly somehow. 

 

Any guidance would be most appreciated. 

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,463 Most Valuable Professional on at

    Hi @JE1 ,

    This is probably one more step than necessary, but it sets it out better

    With(
     {
     w1: Value(Right(DataCardValue1.Text,1)),
     w2: Value(Right(DataCardValue4.Text,1)),
     w3: Value(Right(DataCardValue6.Text,1)),
     w4: Value(Right(DataCardValue8.Text,1)),
     w5: Value(Right(DataCardValue12.Text,1))
     },
     With(
     {
     wMax: Max(w1, w2, w3, w4, w5)
     },
     If(
     wMax < 3,
     LightGreen,
     wMax < 5.9,
     LightCoral,
     Orange
     )
     )
    )

     

    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.

    Visit my blog Practical Power Apps

  • JE1 Profile Picture
    10 on at

    Thanks Warren, 

     

    Would you know why the later IF statement is getting errors for that datacard value? 

  • WarrenBelz Profile Picture
    155,463 Most Valuable Professional on at

    Hi @JE1 ,

    There was an extra bracket in each top section line (dangers of free-typing code) - now fixed in original. I have now tested it on a model and it works fine.

     

    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.

    Visit my blog Practical Power Apps

  • JE1 Profile Picture
    10 on at

    Hi Warren, 

     

    Apologies- I haven't been very clear. 

     

    The issue I am having is with this situation: 

     

    Example- 

     

    Here I have a risk assessment done by Stewart. As the Max Residual risk is lower than 3 I would like the datacard to be green. 

     

    JE1_0-1658188702553.png

     

    JE1_1-1658188702930.png

     

    JE1_2-1658188702656.png

     

     

    If I use this formula in the fill section: 

    If(DataCardValue124 < 3, Green, Red)

     

    I get errors- 

    JE1_3-1658188703006.png

     

     

  • Verified answer
    WarrenBelz Profile Picture
    155,463 Most Valuable Professional on at

    Hi @JE1 ,

    If you look at the structure I posted, you will see you need

    If(
     Value(DataCardValue124.Text) < 3, 
     Green, 
     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.

    Visit my blog Practical Power Apps

  • JE1 Profile Picture
    10 on at

    Thank you Warren! Apologies I missed that. Works perfectly. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard