message: [fix] Pivot table metric ordering
diff: @@ -676,7 +676,7 @@ class PivotTableViz(BaseViz):
  )
  if not metrics:
  raise Exception(_("Please choose at least one metric"))
  - if any(v in groupby for v in columns) or any(v in columns for v in groupby):
  + if set(groupby) & set(columns):
  raise Exception(_("Group By' and 'Columns' can't overlap"))
  return d
  @@ -694,15 +694,18 @@ class PivotTableViz(BaseViz):
  columns = self.form_data.get("columns")
  if self.form_data.get("transpose_pivot"):
  groupby, columns = columns, groupby
  + metrics = [utils.get_metric_name(m) for m in self.form_data["metrics"]]
  df = df.pivot_table(
  index=groupby,
  columns=columns,
  - values=[
  - utils.get_metric_name(m) for m in self.form_data.get("metrics", [])
  - ],
  + values=metrics,
  aggfunc=aggfunc,
  margins=self.form_data.get("pivot_margins"),
  )
  +
  + # Re-order the columns adhering to the metric ordering.
  + df = df[metrics]
  +
  # Display metrics side by side with each column
  if self.form_data.get("combine_metric"):
  df = df.stack(0).unstack()
  