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 / Shifting the Fill colo...
Power Apps
Answered

Shifting the Fill color based on the negating factor

(1) ShareShare
ReportReport
Posted on by

sabrinaaa__0-1719855723254.pngsabrinaaa__1-1719855770679.png

Hi I would like to shift a color (that is the circle) when the column in a same row's category has a value that is other than green into the following negating value (when  there is red it turns into red immediately) any suggestion for the expression?

Categories:
I have the same question (0)
  • Damin Profile Picture
    63 on at

    I suggest for you to use Switch rather then If, in this scenario, Switch works better. In your code I think you are using extra brackets, for example before LookUp function you're using brackets, you don't need.

  • sabrinaaa_ Profile Picture
    on at

    It expected a boolean value instead of "Color.Green" any inputs?

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

    Hi @sabrinaaa_ ,

    I am not sure if the logic is correct here due to your first condition which contradicts the next two, however you might have a look at this structure as it will save a lot of code and is easier to follow

    With(
     {
     _Colour:
     LookUp(
     'INVITE Project',
     ID = ThisItem.ID
     ).'Traffic Light',
     _Start:
     DateDiff(
     Today(),
     ThisItem.BaselineStart,
     TimeUnit.Days
     ),
     _End:
     DateDiff(
     Today(),
     ThisItem.BaselineEnd,
     TimeUnit.Days
     )
     },
     If(
     _Colour = "Green",
     Colour.Green,
     (_Colour = "Green" && _Start > 30) || (_Colour = "Green" && _End > 30),
     Color.Red,
     (_Colour = "Red" && _Start > 0 && _Start <= 30 || (_Colour = "Yellow” && _End > 0 && _End <= 30),
     Color.Yellow,
     Color.Green
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 414

#2
Valantis Profile Picture

Valantis 408

#3
timl Profile Picture

timl 339 Super User 2026 Season 1

Last 30 days Overall leaderboard