Conditional formating based on sysdate

Dear Metabase community,
Is it possible to add conditional formatting to a timestamp or date?
e.g. If I open a question or Dashboard it should mark those dates of a specific column which are greater than system date in red for example.

Is this possible?


Hi @lst
That’s currently (0.32.9) not possible.
A work-around would be to do a Native Query (SQL), where you create an extra column, which is either empty or future depending on the date, and then you format that column/row.
Example, syntax depends on which database you’re querying.

SELECT *, IF(column>CURRENT_DATE, 'future', '') AS 'Conditional'
FROM table
1 Like

Hi @flambe, thanks a lot for your fast feedback. Had this also in mind as a fallback solution. Wouldn’t this be a good feature for the future? What do you think? I would need this to see e.g. if a task was done in time or not (last updated date). I am sure this can be used for a variety of scenarios, e.g. for overdue payments to a customer or supplier etc.

I can see the use-case, but I’m not sure how it should be implemented visually without making everything too complex.
You should create a feature request and then add the link here for reference:

1 Like

I had a similar dashboard where I needed to highlight new users. Solution was to just create a view. Given the complexity of the databases I’m working with and bits like this cropping up all the time, I’ve now restricted all my questions to just use views. Avoids problems with custom SQL while allowing me to make changes easily.