cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
evanscona
Helper I
Helper I

Using multiple Colors with the "With function"

Screen Shot 2021-10-20 at 8.51.07 AM.png

Hi, 

 

I'm trying to added red to my colors but all other colors WORKS except Red. Please can someone help me out with right 

function format? I want all colors show on the App

Thank you.  This my function i used

 

 

 

With(
{
varDiff: DateDiff(
ThisItem.Date,
Today(),
Hours
)
},
If(
varDiff >= 36,
Purple,
varDiff > 24,
Red,
varDiff > 12,
Yellow,
varDiff < 12,
Transparent
)
)

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

hi @evanscona your formula is correct. when the hours = 12 you will get nothing as you do not specify an else value or a condition for 12. maybe set condition for transparent to <= 12. all the colours in your pic reflects correct.

 

Wondering why you are evaluating today() and not now()?\DateDiff(
ThisItem.Date,
Today(),
Hours
)

 

Regards,

R

 

 

View solution in original post

1 REPLY 1
rubin_boer
Super User
Super User

hi @evanscona your formula is correct. when the hours = 12 you will get nothing as you do not specify an else value or a condition for 12. maybe set condition for transparent to <= 12. all the colours in your pic reflects correct.

 

Wondering why you are evaluating today() and not now()?\DateDiff(
ThisItem.Date,
Today(),
Hours
)

 

Regards,

R

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,224)