Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
BRL7WZ
Helper I
Helper I

Highlight all the dates in the column

Hello,

Could someone please help me write a measure that will highlight all the dates in the column that reach today date in 30, 60 and 90 days. For example, if a document expires in 30 days the date colour will be red, if it expires in 60 days it will be orange and if it expires in 90 days it will be yellow.

I have searched the forum but have not found an answer....
Please help.

1 ACCEPTED SOLUTION

If you wish to highlight the data based on expired date (valid to), create this measure and then apply it in conditional formatting to both columns.

 

 

Color = SWITCH(TRUE(),
               AND(MAX([Valid to])-TODAY()>=0,MAX([Valid to])-TODAY()<=30),"red",
               AND(MAX([Valid to])-TODAY()>=31,MAX([Valid to])-TODAY()<=60),"orange",
               AND(MAX([Valid to])-TODAY()>=61,MAX([Valid to])-TODAY()<=90),"yellow"
)

 

 



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!

View solution in original post

6 REPLIES 6
BRL7WZ
Helper I
Helper I

Thank you very much.
It works perfectly.
Have a great day.

BRL7WZ
Helper I
Helper I

Hi,

Yes I confirm, the data type in these columns is "date"

If you wish to highlight the data based on expired date (valid to), create this measure and then apply it in conditional formatting to both columns.

 

 

Color = SWITCH(TRUE(),
               AND(MAX([Valid to])-TODAY()>=0,MAX([Valid to])-TODAY()<=30),"red",
               AND(MAX([Valid to])-TODAY()>=31,MAX([Valid to])-TODAY()<=60),"orange",
               AND(MAX([Valid to])-TODAY()>=61,MAX([Valid to])-TODAY()<=90),"yellow"
)

 

 



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!
johnyip
Solution Sage
Solution Sage

You should provide your sample data whose structure is identical to the actual data you are using. DAX cannot be written without knowing the data structure.



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!

Hello,

My dates look like this:

BRL7WZ_0-1689675799605.png

Is this what you meant?

Are the data type of the columns "date", or they are just text that look like a date?



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors