mudeshankarnaik opened a new issue, #38674: URL: https://github.com/apache/superset/issues/38674
### Bug description I am using Apache Superset to build a DataMart with 200+ metrics. When using the Pivot Table, the Grand Total row is performing a simple SUM() of the rows in the frontend (Javascript) instead of re-calculating the metric using the provided SQL expression. This results in incorrect "Partial Sums" for ratios (e.g., $10\% + 20\% = 30\%$ instead of the correct weighted average). How to Reproduce Create a metric: SUM(numerator) / NULLIF(SUM(denominator), 0). Add this metric to a Pivot Table. Enable "Show Totals". Observe that the Total row sums the individual row percentages. Expected Behavior The Total row should re-execute the metric's SQL formula against the total context (Total Numerator / Total Denominator), similar to how "Partial Sums" work in tools like Qlik. Actual Behavior The total is a simple summation of the values displayed in the table rows. Environment Superset version: 5.0.0 (or your specific version) Database: ClickHouse Feature Flags enabled: ENABLE_BACKEND_PIVOT_TOTALS, GENERIC_CHART_AXES ### Screenshots/recordings _No response_ ### Superset version 5.0.0 ### Python version 3.9 ### Node version 16 ### Browser Chrome ### Additional context I have confirmed that ENABLE_BACKEND_PIVOT_TOTALS = True is set in superset_config.py, but the legacy Pivot Table plugin does not appear to respect this flag. ### Checklist - [x] I have searched Superset docs and Slack and didn't find a solution to my problem. - [x] I have searched the GitHub issue tracker and didn't find a similar bug report. - [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
