diff --git a/caravel/models.py b/caravel/models.py index 02e26b1e603fd..933f10879b660 100644 --- a/caravel/models.py +++ b/caravel/models.py @@ -1186,6 +1186,13 @@ def fetch_metadata(self): metric_type='sum', expression="SUM({})".format(quoted) )) + if dbcol.sum: + metrics.append(M( + metric_name='avg__' + dbcol.column_name, + verbose_name='avg__' + dbcol.column_name, + metric_type='avg', + expression="AVG({})".format(quoted) + )) if dbcol.max: metrics.append(M( metric_name='max__' + dbcol.column_name,