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 / Using switch to set fi...
Power Apps
Unanswered

Using switch to set fill - can I use AND?

(0) ShareShare
ReportReport
Posted on by 23
Dear community, 
 
I am trying to create a timeline that is reactive in fill colour based on the stage of a of progression through the process (SharePoint column col_ProgStage), but also looking at whether that stage is overdue (comparing now to a time column, e.g. col_PartBStartBy).
 
Is it possible to ask Switch to look at progress stage AND date?
 
Currently my code looks like this: 
Switch(varSelectedIAP.col_ProgStage, 2 And DateValue(varSelectedIAP.col_PartBStartBy)< Now(), RGBA (255, 184, 174, 1), RGBA (000,000,000,0)
 
In the app, the error lines are showing currently under Switch and And. Where am I going wrong?
Categories:
  • timl Profile Picture
    37,422 Super User 2026 Season 2 on at
    Hi  HS-11121108-0
     
    Switch doesn't support combining conditions with And.
     
    If you combine If and Switch like so, that should hopefully work better for you. In the formula beneath, the switch part controls the colour depending on the ProgStage.
     
     
    If(
        varSelectedIAP.col_ProgStage = 2 && DateValue(varSelectedIAP.col_PartBStartBy) < Now(),
        RGBA(255, 184, 174, 1),
        Switch(
            varSelectedIAP.col_ProgStage,
            1, RGBA(255, 255, 255, 1),
            2, RGBA(0, 0, 0, 0),
            RGBA(255, 255, 255, 1) 
        )
    )
     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard