cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Conditional Formatting Date in Card Visual

I have a card visual  that displays a date from a field in my data model. I would like to be able to use conditional formatting to change the color of either the background or the text if the date is beyond a certain threshold compared to today's date, ie color it red if greater than 30 days ago. I haven't been able to figure out if that is possible or not. I found the conditional formatting for the visual but was unable to successfully get it to work. Thanks for any help I can get.

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

@Chris_Evans , You can create a color measure and use that in conditional formatting

 

Color Date = if(FIRSTNONBLANK('Date'[Date],TODAY()) <today(),"lightgreen","red")

Or

Color Date =

Var _max =maxx(Table,Table[date])

return

if(FIRSTNONBLANK('Date'[Date],TODAY()) <_max ,"lightgreen","red")

 

Refer:https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Highlighted
Super User IV
Super User IV

@Chris_Evans , You can create a color measure and use that in conditional formatting

 

Color Date = if(FIRSTNONBLANK('Date'[Date],TODAY()) <today(),"lightgreen","red")

Or

Color Date =

Var _max =maxx(Table,Table[date])

return

if(FIRSTNONBLANK('Date'[Date],TODAY()) <_max ,"lightgreen","red")

 

Refer:https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted

@amitchandak 

 

That worked perfectly. I just added -30 to the statement to get the results i needed. Thank you.

 

ColorDate = if(FIRSTNONBLANK(AgendaUpdates[last_update],TODAY()) <today() - 30,"red","black")

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors