Age filter from DOB

I have Date of Birth column.

I would like to add a age filter. I was hoping there is something called calculated column which I can create but I do not see that feature. How do I implement such functionality.

  1. Add age as filter based on DOB
  2. Group by Age

Hi @jiwnaiakbar
Currently Metabase does not have a way to handle dates in expressions (e.g. Custom Columns):
https://github.com/metabase/metabase/issues/11330 - upvote by clicking :+1: on the first post
So a workaround would be to create a Native/SQL query that makes that conversion and then you can reuse the question as the base for other questions via Saved Questions.
Example on MySQL - search stackoverflow.com if you’re using a different database

SELECT *, TIMESTAMPDIFF(YEAR, `BIRTH_DATE`, DATE(NOW())) AS `age` FROM `PEOPLE`
1 Like