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 / Change Gallery Templat...
Power Apps
Unanswered

Change Gallery Template Fill based on Date

(0) ShareShare
ReportReport
Posted on by 181

Hello.

 

I have an app which as part of its function tracks staff reviews. Within the app there are two date fields 'Review Due' and 'Review Completed'

 

I would like the gallery template fill to change colour depending on how close to the review date we are if it hasn't been completed. something like this:

 

If Review Date = Review Completed, color.lightgreen

 

If Review Date is 1 week away, color.red

If Review Date is 2 Weeks away color.orange

If Review Date is 3 Weeks Away, color.yellow

 

I can get the completed reviews to turn green with no problems using:

 

 

If(ThisItem.ReviewDate = ReviewCompleted, Color.LightGreen,
Color.White
)

 

 

I just need some help with the code for the upcoming review colours.


Many thanks

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

    Hi @Angry_Sys_Admin ,

    Try this format

    With(
     {
     _Days:
     DateDiff(
     Today(),
     ThisItem.ReviewDate,
     TimeUnit.Days
     )
     },
     If(
     Value(ThisItem.ReviewCompleted) > 1,
     Color.White,
     _Days <=7,
     Color.Red,
     _Days <=14,
     Color.Orange,
     _Days <=21,
     Color.Yellow,
     Color.White
     )
    )

     

    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

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard