# Add comparison metrics and running totals

Compare row data to total and running values in your charts.

You can easily add metrics that compare each row of your data to the total value of a column by using the Display As option. You can also use this option to apply running calculations.

## Add comparison metrics to a chart

2. Select a chart.
3. In the DATA properties panel, select a metric and click its edit pencil .
4. Click the Display As drop-down menu and select the desired comparison. See below.
5. To display the metric's native value, change the Display As selection to None.

### Compare to total

You can compare each row of data to the overall total for that field:

1. Percent of total shows the current row's value divided by the total for that field.
2. Difference from total shows the total for that field minus the current row's value.
3. Percent difference from total shows the total for that field minus the current row's value divided by the total for that field.

### Example

The table below 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. ### Compare to max

You can compare each row of data to the maximum value for that field:

1. Percent of max shows the current row's value divided by the maximum value for that field.
2. Difference from max shows the current row's value minus the maximum value for that field.
3. Percent difference from max shows the current row's value minus the maximum value for that field divided by the total for that field.

### Example

The table below 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. ### Relative comparison

When 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.

For example, the time series charts below compare the current 28 days to the previous 28 days. The first two charts show the original data. 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. Original data.

The next chart applies the percent of max function, relative to base data. Every data point for the previous period is divided by the maximum value of the current period (1,947). For the data point on June 4, the percentage of max is 1571/1947 = 80.69%. Percent of max, relative to base data.

The final chart applies the percent of max function, relative to corresponding data. Every data point for the previous period is divided by the maximum value of the previous period (1,571). For the data point on June 4, the percentage of max is 1571/1571 = 100%. Percent of max, relative to corresponding data.

## Apply running calculations

Running calculations, also known as analytic functions, compute summary results across a collection of values. But unlike the metric comparisons described above, running calculations return a value for each row of input, expressing that row's relation to the collection as a whole.

The example below shows the application of 2 running calculations to the Analytics Users metric:

1. Running sum
2. Running delta

This allows you to see the cumulative number of users you have acquired up to a specific day, and how each day's numbers differ from each other.

### Example See a demonstration report here.

Currently, Data Studio supports the following running calculations:

• Running sum
• Running average
• Running min
• Running max
• Running delta
• Running count

### To apply a running calculation

2. Select a chart.
3. In the DATA properties panel, select a metric and click its edit pencil .
4. Click the Apply running calculation drop-down menu and select the desired function.
5. To remove a running calculation, change the Apply running calculation option to None.
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.)

## Differences between running calculations and calculated fields

Running calculations make it easy to show complex data relationships, without having to code custom SQL queries in your data set. Such queries would be difficult, if not impossible to replicate in a calculated field in your data source.

Currently, however, unlike calculated fields, you can't edit the formulas of running calculations.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8600015,"math_prob":0.9654075,"size":4283,"snap":"2019-43-2019-47","text_gpt3_token_len":871,"char_repetition_ratio":0.15891564,"word_repetition_ratio":0.29338843,"special_character_ratio":0.21130049,"punctuation_ratio":0.0964467,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99392223,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"im_url_duplicate_count":[null,null,null,9,null,5,null,9,null,9,null,9,null,9,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-11-19T03:18:43Z\",\"WARC-Record-ID\":\"<urn:uuid:df3914ff-e81c-4ae1-9a6a-74d3f761666b>\",\"Content-Length\":\"466974\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d2aa3469-aecb-428f-969a-821e29672ea2>\",\"WARC-Concurrent-To\":\"<urn:uuid:cb39249d-9778-4451-adba-67eeea16dabc>\",\"WARC-IP-Address\":\"172.217.13.238\",\"WARC-Target-URI\":\"https://support.google.com/datastudio/answer/9372465?hl=en&ref_topic=9372036\",\"WARC-Payload-Digest\":\"sha1:XQU4TZOJ5LDBVTGBUQCQ2FXFGSP6HFL6\",\"WARC-Block-Digest\":\"sha1:ZOMM4W2YGWEHMSM34FXJ7EYHLVZZ4ZXA\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-47/CC-MAIN-2019-47_segments_1573496669967.80_warc_CC-MAIN-20191119015704-20191119043704-00217.warc.gz\"}"}