diff --git a/sites/docs/pages/components/data/data-table/index.md b/sites/docs/pages/components/data/data-table/index.md index dc1f579fdc..5182d585a4 100644 --- a/sites/docs/pages/components/data/data-table/index.md +++ b/sites/docs/pages/components/data/data-table/index.md @@ -368,6 +368,25 @@ limit 5 ``` +#### Aggregating Percentage Changes + +When aggregating percentage changes (e.g., year-over-year growth rates) in a total row, a simple average can be misleading. Instead, use `totalAgg=weightedMean` with a `weightCol` to calculate a properly weighted average. + +For example, to aggregate growth rates weighted by the size of each entity (e.g., GDP): + +```svelte + + + + + +``` + +In this example, regions with higher revenue contribute more to the overall growth rate calculation, giving you an accurate weighted average. #### Custom Aggregations Values