[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Add comparison metrics and running totals\n\nYou can add metrics that compare each row of your data to the total value of a column. You can also apply running calculations to the data in your charts.\n\nAdd comparison metrics to a chart\n---------------------------------\n\n1. [Edit your report](/looker/docs/studio/edit-a-report).\n2. Select a chart.\n3. In the **Properties** panel, select the **SETUP** tab.\n4. Choose a metric and click the edit edit option.\n5. Click the **Comparison calculation** menu, and then select a comparison.\n6. To display the base value of the metric, change the **Comparison calculation** selection to **None**.\n\n### Compare to total\n\nYou can compare each row of data to the overall total for that field:\n\n- **Percent of total** shows the current row's value divided by the column total.\n- **Difference from total** shows the column total minus the current row's value.\n- **Percent difference from total** shows the column total minus the current row's value divided by the column total.\n\nFor each of these total comparisons, you can also select **Ignore canvas filters in total** to compute the total value without applying viewer-applied filters, such as [controls](/looker/docs/studio/about-controls). Total rows still include [filter properties](/looker/docs/studio/about-filter-properties).\n\n### Example\n\nThe following table shows the results of applying different \"compare to total\" options to the **Order value** field.This lets you evaluate each order's contribution to overall sales.\n\n### Compare to max\n\nYou can compare each row of data to the maximum value for that field:\n\n- **Percent of max** shows the current row's value divided by the maximum value.\n- **Difference from max** shows the current row's value minus the maximum value.\n- **Percent difference from max** shows the current row's value minus the maximum value divided by the maximum value.\n\n### Example\n\nThe following table shows the results of applying different \"compare to max\" options to the **Order value** field. This lets you see how each order compares to the maximum order.\n\n### Relative comparison\n\nWhen your chart includes a comparison date range, you can apply the comparison function to either the base data or to the corresponding comparison date range.\n\nFor example, consider a time series chart that compares the current 28 days to the previous 28 days. The maximum value of **Sessions** for the current period was 1,947 on June 26. The maximum value of **Sessions** for the previous period was 1,571 on June 4.\n\nIf you apply the **Percent of max** function relative to base data, then every data point for the previous period will be divided by the maximum value of the current period (1,947). For the data point on June 4, the **Percent of max** relative to base data would be: 1571/1947 = 80.69%.\n\nIf you instead apply the **Percent of max** function relative to corresponding data, then every data point for the previous period will be divided by the maximum value of the previous period (1,571). For the data point on June 4, the **Percent of max** relative to corresponding data would be: 1571/1571 = 100%.\n\nApply running calculations\n--------------------------\n\nRunning calculations compute summary results across a collection of values. Running calculations return a value for each row of input, expressing that row's relation to the collection as a whole.\n\nThe following example shows the application of two running calculations to the **Users** metric:\n\n- **Running sum**\n- **Running delta**\n\n### Example\n\nSee a [demonstration report](https://lookerstudio.google.com/reporting/1DA4qG1pPOqc4KwQz0QpN1rskVGaCdH5I/page/1PzS?utm_source=hc&utm_medium=link&utm_campaign=article&utm_content=demo-reports) here.\n\nLooker Studio supports the following running calculations:\n\n- Running sum\n- Running average\n- Running min\n- Running max\n- Running count\n- Running delta\n- Running percentage delta\n\n### To apply a running calculation\n\n1. [Edit your report](/looker/docs/studio/edit-a-report).\n2. Select a chart.\n 3.\n In the **Properties** panel, select the **SETUP** tab.\n\n3. Add a metric to chart, and then click the edit edit option.\n\n4. Click the **Running calculation** menu, and select a function.\n\n5. To remove a running calculation, change the **Running calculation** option to **None**.\n\n\u003e To display the original metric and the metric comparison or running calculation in the same chart, add a second instance of the original metric by dragging it from the **Available Fields** panel. (You can't add a duplicate field using the metric or dimension picker.)\n\nDifferences between running calculations and calculated fields\n--------------------------------------------------------------\n\nCalculated fields work on the data in your charts on a row-by-row basis. Running calculations work across rows, making it easy to show complex data relationships without having to code custom SQL queries in your dataset. Such queries would be difficult if not impossible to replicate in a calculated field in your data source.\n\nHowever, unlike with calculated fields, you can't edit the formulas of running calculations.\n\nLimitations of comparison metrics\n---------------------------------\n\nThe **[Group others](/looker/docs/studio/table-reference#number_of_rows)** option is not compatible with comparison metrics. To use comparison metrics on a chart, disable the **Group others** option."]]