Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Change fill colour when date past

(0) ShareShare
ReportReport
Posted on by 18

Hello ,good evening. I have run in to a bit of a problem , so close.

 

Switch(
true,
DataCardValue14.SelectedDate < Today(), Color.Red,
DateDiff(Today(), DataCardValue14.SelectedDate, Months) >= 1, Color.Orange,
true, Color.White
)

In this formula when no conditions are met doesn't want to default to white , stays on orange ,

when due date has past todays date the red works . 

puzzled . 

any guidance appreciated please 

 

  • DJ_Jamba Profile Picture
    2,822 Super User 2025 Season 1 on at
    Re: Change fill colour when date past

    No probs and glad it's solved!

    d(-_-)b

  • Benson23 Profile Picture
    18 on at
    Re: Change fill colour when date past

    Thank you . @DJ_Jamba . you are correct , I realised what id have done wrong , i needed orange to be 1 month leading up to the due date . my mistake .

    kind regards 

    benson23 

  • DJ_Jamba Profile Picture
    2,822 Super User 2025 Season 1 on at
    Re: Change fill colour when date past

    No that is the correct colour based on the condition:

    DateDiff(Today(), DataCardValue14.SelectedDate,TimeUnit.Months) >= 1, Color.Orange

    Anything over 1 month will result in Orange as per your condition

  • DJ_Jamba Profile Picture
    2,822 Super User 2025 Season 1 on at
    Re: Change fill colour when date past

    It is working fine for me based on the scenario you posted.
    Can you try it out in a new screen with just a date picker and apply the code on the Fill property of a text label?

    See attached gif...

  • Benson23 Profile Picture
    18 on at
    Re: Change fill colour when date past

    Benson23_0-1711578806223.png

    in above app the orange should be white ,mh/sa review is one year plus date from mh/sa . thought show the context .

  • Benson23 Profile Picture
    18 on at
    Re: Change fill colour when date past

    Hi @DJ_Jamba .

    thank you for replying , 

    have tried that formula previous , but still unable to default back to white , 

    very confusing !

  • Verified answer
    DJ_Jamba Profile Picture
    2,822 Super User 2025 Season 1 on at
    Re: Change fill colour when date past

    Hi @Benson23 

    Could you try:

    If(
     DataCardValue14.SelectedDate < Today(), Color.Red,
     DateDiff(Today(), DataCardValue14.SelectedDate,TimeUnit.Months) >= 1, Color.Orange,
     Color.White
    )

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1