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 / Change fill colour whe...
Power Apps
Unanswered

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 

 

Categories:
I have the same question (0)
  • Verified answer
    DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    Hi @Benson23 

    Could you try:

    If(
     DataCardValue14.SelectedDate < Today(), Color.Red,
     DateDiff(Today(), DataCardValue14.SelectedDate,TimeUnit.Months) >= 1, Color.Orange,
     Color.White
    )
  • Benson23 Profile Picture
    18 on at

    Hi @DJ_Jamba .

    thank you for replying , 

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

    very confusing !

  • Benson23 Profile Picture
    18 on at

    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 .

  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    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...

  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    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

  • Benson23 Profile Picture
    18 on at

    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,837 Super User 2025 Season 2 on at

    No probs and glad it's solved!

    d(-_-)b

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard