diff --git a/superset/viz.py b/superset/viz.py index 1a93adbfbe2b8..786fad11da942 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -1825,7 +1825,10 @@ def get_data(self, df): metric = flt.get('metric') df = self.dataframes.get(col) if metric: - df = df.sort_values(metric, ascending=flt.get('asc')) + df = df.sort_values( + utils.get_metric_name(metric), + ascending=flt.get('asc'), + ) d[col] = [{ 'id': row[0], 'text': row[0],