GitHub user dosubot[bot] added a comment to the discussion: Pivot Table V2: Incorrect subtotals for non-additive metrics (%)
<!-- Answer --> Hi @pmilsomadaxa! I'm [Dosu](https://go.dosu.dev/dosubot) and I'm helping the Apache Superset team. **No, correct subtotaling of non-additive metrics (ratios/percentages) does not work in Superset 6.0.0** — this is an unresolved architectural limitation that persists across all current versions. **Root cause:** Superset's backend post-processing receives pre-aggregated SQL results (your Margin % is already calculated per row) and then treats all numeric columns as additive when computing subtotals. It sums the displayed percentages rather than recalculating `SUM(revenue_amt - calc_cogs_amt) / NULLIF(SUM(revenue_amt), 0)` at the subtotal grouping level [[1]](https://github.com/apache/superset/issues/38674#issuecomment-4066762404). **Status of the references you found:** - **PR #34592** proposes a multi-query architecture (separate SQL queries per aggregation level) to fix this, but it has been **open and unmerged for ~9 months** [[2]](https://github.com/apache/superset/pull/34592) - **Issue #25747** remains open — it's the target issue for PR #34592 - There is no feature flag or configuration option that enables correct non-additive subtotals [[1]](https://github.com/apache/superset/issues/38674#issuecomment-4066762404) **There is no release containing a fix for this.** The issue is tracked across multiple open tickets (#25747, #32260, #38674, #36165) and a maintainer has noted it's "not a pressing issue for committers from the Preset team, but we're happy to review solutions" [[3]](https://github.com/apache/superset/issues/32260#issuecomment-4232951807). **Workarounds:** 1. Avoid enabling subtotals/totals for non-additive metrics in the pivot table 2. Consider splitting your dashboard so that the ratio metric is displayed separately without subtotals, while additive metrics (Revenue, Margin) use subtotals normally There are also broader proposals in flight — [SIP-179](https://github.com/apache/superset/issues/34245) for per-metric aggregation customization and [SIP-205](https://github.com/apache/superset/issues/38586) for an AntV S2-based pivot table — but neither has shipped yet. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=ca068844-1744-4eac-b11e-8e8d21a437db) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset) GitHub link: https://github.com/apache/superset/discussions/40965#discussioncomment-17259785 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
