#44725·superset

Pivot table reports/exports pick an arbitrary metric for a mixed-metric total instead of blanking it

Author: rusackasCreated Sep 27, 2026Updated Sep 28, 2026
Labelspreset-io🦾 ai-candidate

Bug description

superset/charts/client_processing.py's _collapsed_metric (used by the scheduled-report/alert/CSV/Excel export path for pivot_table_v2) resolves a mixed-metric total (a "Metric"-collapsed row/column/grand total on a pivot with 2+ metrics on one axis) to an arbitrary metric -- the last one in the chart's configured metric order -- and computes a real percentage for it in showValuesAs percent modes.

This now disagrees with the live browser view: apache/superset#44657 changed the browser to render that same cell blank instead, since there's no single meaningful value for "MAX(sales) combined with MEDIAN(msrp)" (or whichever two metrics happen to share the collapsed slot). A scheduled report or export can therefore show a specific, plausible-looking percentage for a cell the interactive chart deliberately leaves blank.

_collapsed_metric's own docstring is now stale -- it explicitly says it mirrors "the last metric pushed into the shared slot (see the metricAxis handling in react-pivottable/utilities.ts)", which was the browser's old behavior before #44657.

How to reproduce

  1. A pivot_table_v2 chart with 2+ metrics laid out on columns (metricsLayout: Columns), showValuesAs set to a percent mode, row and/or column totals enabled.
  2. Compare the grand-total/Total-axis cell opposite the Metric pseudo-dimension between the live Explore view (blank, per #44657) and a scheduled report, alert, or CSV/Excel export of the same chart (a computed percentage).

Scope note

This is separate from #44625 (which was about non-additive metrics re-aggregating already-aggregated cells in Actual Values mode, fixed by #44631) -- this is specifically about the mixed-metric "last metric wins" fallback in _collapsed_metric, only reachable with 2+ metrics sharing a collapsed axis slot.