Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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.
Solved! Go to 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"
)
Thank you very much.
It works perfectly.
Have a great day.
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"
)
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.
Hello,
My dates look like this:
Is this what you meant?
Are the data type of the columns "date", or they are just text that look like a date?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.