Puoi utilizzare subquery funzione
subquery = from t in "Table1"
|> select([t], %{categoty: t.category, max_date: max(t.date)})
|> group_by([t], t.category)
from t in "Table1"
|> join(:inner, [u], t in subquery(subquery), t.category == u.category and t.max_date == u.date)
|> Repo.all