# Compare Dates and Show font in red based on result

**URL:** <https://community.eazybi.com/t/compare-dates-and-show-font-in-red-based-on-result/5525>\
**Category:** Questions & Answers\
**Tags:** markdown, mdx\
**Created:** [October 28, 2020, 4:58am UTC](https://community.eazybi.com/t/compare-dates-and-show-font-in-red-based-on-result/5525 "2020-10-28T04:58:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![zane.baranovska](https://community.eazybi.com/user_avatar/community.eazybi.com/zane.baranovska/32/7209_2.png) [@zane.baranovska](https://community.eazybi.com/u/zane.baranovska)\
**Post date:** [November 3, 2020, 10:35am UTC](https://community.eazybi.com/t/compare-dates-and-show-font-in-red-based-on-result/5525/2 "2020-11-03T10:35:31Z")

</div>

Hi @Tanu,

You are on the right track. There are a few adjustments to make this work.

1. Use function **DateCompare()** to compare two dates. There are more details and example of this function: [DateCompare](https://docs.eazybi.com/eazybi/analyze-and-visualize/calculated-measures-and-members/mdx-function-reference/datecompare)

2. Date that you would like to show in the red color should be between `<span ...>` and `</span>`.

3. Make sure to set measure **formatting** to **Markdown** ([Calculated measures and members](https://docs.eazybi.com/eazybi/analyze-and-visualize/calculated-measures-and-members#Calculatedmeasuresandmembers-Formatting))

The updated formula might look like this:

```
CASE WHEN --compare two dates
  DateCompare(
    [Measures].[Actual IRL1 Exit Date],
    [Measures].[Target IRL1 Exit Date]
  ) > 0
THEN --if Actual date > Target date
  "<span style='color:red'>" || 
  Format([Measures].[Issue Date IRL 2 Entry],'dd mmm yyyy')
  || "</span>" 
END

```

Check out tips and tricks on measure formatting for more examples:

> [@Measure formatting (markdown and custom)](https://community.eazybi.com/t/measure-formatting-markdown-and-custom/5157):
>
> In this article, I will show a few tips and tricks on how it is possible to format the measures. In eazyBI, there are two interesting ways on how to [format measures](https://docs.eazybi.com/eazybi/analyze-and-visualize/calculated-measures-and-members/calculated-measures#Calculatedmeasures-Formatting) to get a different appearance. First is our newest formatting option, Text-\>Markdown (available on Cloud and starting from the eazyBI version 6.1), and second is a Custom format with which you can change the formatting of the measure. [eazyBI\_Markdown] Markdown You can use [Markdown](http://en.wikipedia.org/wiki/Markdown) formatting to show a rich text (bold, italic) or …

Best,  
Zane [support@eazyBI.com](mailto:support@eazyBI.com)

---

_[View the full topic](https://community.eazybi.com/t/compare-dates-and-show-font-in-red-based-on-result/5525)._
