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 / Color rectangle based ...
Power Apps
Unanswered

Color rectangle based on date

(0) ShareShare
ReportReport
Posted on by 61

Hi

 

I have a 'START' and 'END' date in my list.

In my gallery i want to see a rectangle that is green when today is between start and end date.
It must be red when its not.

 

 

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @Wagemans_Frank,

    Please set the TemplateFill property as below:

     

    If(Now() >= ThisItem.START&&Now() <= ThisItem.END,Color.Green,Color.Red)

     

  • Wagemans_Frank Profile Picture
    61 on at

    Hi

     

    All mij rows are the same color.

     

    My startdate is a column with a date.

    I have an extra column (text) with the days.

    My enddate is a column (text) with a formula  DATEVALUE(thisitem.startdate)+(Thisitem.days)

     

    How do i configure this to change the color green when Now() is not between Startdate and enddate?

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @Wagemans_Frank,

    To be honest, I don't get you.

    Sorry that I could not reproduce this issue in my environment.

     

    To do the calculation, we need to convert the data into number value, not sure how you format your date string in the Text column, however it is another workload to convert the text date string into date value, which costs a lot of time, I don't think this makes sense.

     

    To be more efficient, you should create Date column saving date value and number column to save the days, and in Power Apps do the calculation thing, using the following formula to calculate the end date:

    DateAdd(ThisItem.START, ThisItem.Days, Days)
    

     Then Modify the formula as below:

    If(Now() >= ThisItem.START&&Now() <= DateAdd(ThisItem.START, ThisItem.Days, Days),Color.Green,Color.Red)

     

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard