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 / 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
    153,084 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

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard