dosubot[bot] commented on issue #34426:
URL: https://github.com/apache/superset/issues/34426#issuecomment-3140010524

   <!-- Greeting -->
   Hi @GiuGit7! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.
   
   <!-- Answer -->
   This is a known limitation in Superset tables: by default, percentage 
metrics in table visualizations are calculated only from the data on the 
current page (the "row_limit"), not from the entire dataset, which leads to 
incorrect percentages when pagination is enabled. To fix this, set the 
"Percentage metric calculation" option in the table chart controls to "All 
records"—this will make Superset calculate percentages based on the full 
dataset, even with pagination enabled. You can find this option in the table 
chart's control panel under "Percentage metric calculation" (choices: 
"row_limit" or "all_records") 
[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx).
   
   Charts and tables use different aggregation logic: charts often aggregate 
over the entire dataset or group, so tooltips show correct percentages, while 
tables default to per-page calculations unless you change this setting 
[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts).
   
   If you need more control (like percent-of-group within a table), you can 
define a custom SQL metric in your dataset to pre-calculate the percentage you 
want [source](https://github.com/apache/superset/discussions/33842).
   
   There is also an open proposal (SIP-179) to allow more flexible aggregation 
per metric in tables, but as of 4.1.3, aggregation for totals/subtotals is 
uniform across all fields 
[source](https://github.com/apache/superset/issues/34245).
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/1c38525c-2c04-4588-b31f-b474edfb8618?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/1c38525c-2c04-4588-b31f-b474edfb8618?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/1c38525c-2c04-4588-b31f-b474edfb8618?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/1c38525c-2c04-4588-b31f-b474edfb8618?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/1c38525c-2c04-4588-b31f-b474edfb8618?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/1c38525c-2c04-4588-b31f-b474edfb8618?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/1c38525c-2c04-4588-b31f-b474edfb8618?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34426)


-- 
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]

Reply via email to