Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Conditional formatting with dates not working

Gradient is not working for dates from MAX to MIN, anyone knows why? 😞 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    Here's my solution.

    Create a measure to convert the dates to numbers.

    Measure = VALUE(FORMAT(MAX('Table'[Date]),"YYYYMMDD"))

     

    Set up the conditional formatting for dates.

     

    Select the measure field.

    Click OK.

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • ppm1's avatar
    ppm1
    Icon for Solution Sage rankSolution Sage

    If you look at your conditional formatting, I suspect it is coloring based on the count of that date column. To get your desired effect, create a measure like this one, and use it in your conditional formatting (choose Field value and then your new measure). You could do other calculation (e.g., vs. your min or max date instead of TODAY(), but you need to do something other than count.

     

    DateColor = INT(TODAY() - MAX(DateTest[Date]))

    Pat

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Pat, thank you taking the  time to answer me, but I´m not understanding quit good the solution (and also I don´t see the gradent in the example you gave me). I want the most recent date to be like in dark blue, and keep gradienting into the oldest date to be pale blue, and it´s happening like the pic I uploaded. 😞 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous ,

       

      Here's my solution.

      Create a measure to convert the dates to numbers.

      Measure = VALUE(FORMAT(MAX('Table'[Date]),"YYYYMMDD"))

       

      Set up the conditional formatting for dates.

       

      Select the measure field.

      Click OK.

       

       

      Best Regards,

      Stephen Tao

       

      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.