> [!NOTE]
> **Note:** KPI (Single Value) charts replace the single value chart option by default. Your admin can enable the **Use Legacy Single Value Visualization** setting in the [**Legacy features** page of the **Admin** panel](https://docs.cloud.google.com/looker/docs/2622/legacy-feature-schedule.md.txt#use-single-value-visualization) to continue using single value (legacy) charts. If your admin didn't previously enable the KPI (Single Value) preview feature, then the **Use Legacy Single Value Visualization** setting will be enabled by default, and you'll still see the [single value (legacy)](https://docs.cloud.google.com/looker/docs/2622/single-value-options) chart option.

KPI (Single Value) charts highlight key performance metrics --- such as total revenue, active users, or conversion rates --- to provide immediate, at-a-glance insight into business performance. By combining a prominent primary metric with contextual elements like sparklines, progress bars, and value comparisons, KPI charts help you quickly identify trends, evaluate progress toward goals, and build scannable dashboards and Explores. This page provides an overview for using and customizing KPI (Single Value) charts in Looker.

![A KPI visualization with a progress bar and a sparkline that compares the first time purchase count with the overall order count.](https://docs.cloud.google.com/static/looker/docs/images/kpi-vis-example-2620.png)

## Things to know

When several single value visualizations appear on a dashboard, each visualization defaults to using the same font size for a consistent appearance. However, single value visualizations automatically resize fonts when a tile size is reduced. If the font for a visualization cannot show the entire value in the space available, then the value is truncated by an ellipsis (...).

If the [**Smart Single Value Text Size** feature](https://docs.cloud.google.com/looker/docs/2622/admin-panel-general-settings.md.txt#smart_single_value_text_size) is enabled, the displayed fonts on single value visualizations in dashboard tiles automatically resize to display at least 8-10 value characters within the tile at any given size.

## KPI (Single Value) chart options

> [!IMPORTANT]
> **Important:** Options that are listed in the menu may appear as unavailable or be hidden when they conflict with other settings that you have chosen.

To use a KPI (Single Value) visualization, select the **KPI (Single Value)** option in the Explore **Select chart** or **Change chart** menu. Next, select the **Style** tab in the **Configure** panel to edit your chart.

You can make selections in the [**Style**](https://docs.cloud.google.com/looker/docs/2622/kpi-single-value-options.md.txt#style-menu-options), [**Comparison**](https://docs.cloud.google.com/looker/docs/2622/kpi-single-value-options.md.txt#comparison-menu-options), and [**Formatting**](https://docs.cloud.google.com/looker/docs/2622/kpi-single-value-options.md.txt#formatting-menu-options) menus to customize the appearance of the KPI (Single Value) visualization.

### Style menu options

The **Style** menu includes the following options.

#### Colors Collection

Choose a color collection from the **Colors Collection** menu. A collection lets you create themed visualizations and dashboards that look good together. You can see all the palettes in each of Looker's built-in color collections on the [Color collections](https://docs.cloud.google.com/looker/docs/2622/color-collections.md.txt) documentation page. Your Looker admin may also create a custom color collection for your organization.

#### Primary Value

The settings in this section let you choose the primary value for the KPI (Single Value) visualization, including the following:

- **Primary Series** : Choose a measure from the Explore to set as a primary series. The value of the measure will be the value that is compared against when the [**Show Comparison**](https://docs.cloud.google.com/looker/docs/2622/kpi-single-value-options.md.txt#show_comparison) setting in the **Comparison** menu is turned on.
- **Primary Row** : Specify a row's value from the **Primary Series** to display. Options include **1st** , **2nd** , **Last** , and **Total** (when [**Totals** are enabled](https://docs.cloud.google.com/looker/docs/2622/creating-and-editing-explores.md.txt#displaying_totals)). **1st** is selected by default.
- **Alignment** : Choose an alignment option for the values in the visualization. Options include **Left** , **Center** , and **Right**. This setting applies to all of the values in the visualization.

#### Value Color

To set the color of the chart value, click the color swatch in the **Value Color** section to open the color picker menu.

- To pick a color from a palette, click the **Palettes** tab of the color picker menu, and then use the left and right arrows to scroll through the available palettes. Select a color by clicking on a color in one of the palettes.
- To select a custom color, click the **Custom** tab of the palette picker, and then either use the color gradient and value slider to choose a custom color, or enter an RGB [hex string](https://www.w3schools.com/colors/colors_hexadecimal.asp), such as `#2ca6cd`, or [CSS color name](https://www.w3schools.com/cssref/css_colors.asp), such as `mediumblue`, into the input field.

Looker will use the selected color for single value visualizations both with and without hyperlinks.

Depending on your needs, consider using the following alternate techniques:

- Change the font color to differentiate between good or bad results: Turn on the [**Show Comparison**](https://docs.cloud.google.com/looker/docs/2622/kpi-single-value-options.md.txt#show_comparison) setting in the **Comparison** menu, and choose the **Show as Change** option.
- Change the font color for a particular field's value everywhere, including in the Explore **Data** pane: A LookML developer can add an [`html`](https://docs.cloud.google.com/looker/docs/2622/reference/param-field-html) parameter to the field definition.

#### Value Format

You can specify the format of the value, independent of the underlying dimension or measure. The field accepts Excel-style formatting. If no formatting is specified, the value displays in the format of the underlying dimension or measure.

MS Excel's complete guide details how to specify these formats [in their documentation](https://support.office.com/en-us/article/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5). However, color formatting is not currently supported in Looker.

> [!TIP]
> **Tip:** For Looker developers: The formatting that's used in the **Value Format** field is the same as the formatting that's used with the [`value_format` LookML parameter](https://docs.cloud.google.com/looker/docs/2622/reference/param-field-value-format), except that the `value_format` parameter requires the formatting string to be enclosed in double quotes. In the **Value Format** field, the formatting string isn't enclosed in quotes.

The [Adding custom formatting to numeric fields](https://docs.cloud.google.com/looker/docs/2622/custom-formatting.md.txt#custom_formatting_examples) documentation page provides more information on how to use custom formatting.

#### Auto Resize Value

Enabling the **Auto Resize Value** option automatically resizes the font on the single value visualization that's displayed within dashboard tiles. Fonts are resized to display at least 8-10 value characters within a tile; if the characters in the visualization overflow horizontally or vertically at a given size, the font size will decrease incrementally. The minimum font size allowed is 14 pixels. Once the minimum font size is reached, any overflowing characters will be truncated with an ellipsis (...). The maximum font size allowed is 104 pixels.

When you're using this feature, single value tiles on dashboards may look less consistent, but more characters will fit on smaller tiles.

This setting has no effect if the [**Smart Single Value Text Size** setting](https://docs.cloud.google.com/looker/docs/2622/admin-panel-general-settings.md.txt#smart_single_value_text_size) is enabled on the **Admin \> General Settings** page. To use this per-visualization control, the admin-level setting must be disabled.

#### Show Title

You can determine whether a title appears on the chart. For a saved Look, the default title is the name of the Look. You also can specify a different title by using the **Title Override** field.


#### Title Override

You can specify a title to display with the value. This field is available when **Show Title** is on. For a saved Look, if this field is left empty, the title defaults to the name of the saved Look.

#### Show Spark Chart

Turn on the **Show Spark Chart** setting to display a secondary visualization that shows the change of the data value. When this setting is turned on, you can customize the secondary visualization with the following settings:

- **Chart Type** : Choose either **Area** chart or **Column** chart as the secondary visualization.
- **Chart Color** : Choose a color for the secondary visualization, similarly to the [Value Color](https://docs.cloud.google.com/looker/docs/2622/kpi-single-value-options.md.txt#value-color) setting.
- **Visible X Axis**: Turn this setting on to display X Axis values for the secondary chart.
- **Show Sparkline Tooltip**: Turn this setting on for tooltips to appear when users hover over a datapoint in the sparkline.

#### Custom Tooltip

You can click the **Custom Tooltip** switch to configure a custom tooltip for the [primary value](https://docs.cloud.google.com/looker/docs/2622/kpi-single-value-options.md.txt#primary-value). You can configure the custom tooltip in the [Explore visualization editor](https://docs.cloud.google.com/looker/docs/2622/creating-visualizations.md.txt#quick_guide) by using a combination of UI settings and an HTML editor that supports Liquid templating. [Learn more about **Custom Tooltips**](https://docs.cloud.google.com/looker/docs/2622/custom-tooltips.md.txt).

### Comparison menu options

The **Comparison** menu includes the following options.

#### Show Comparison

You can turn on the **Show Comparison** setting to add comparison information from a second field to your KPI (Single Value) visualization. When the **Show Comparison** setting is enabled, you can use the style options that appear on the **Comparison** menu.

#### Comparison Series

The comparison series appears underneath the primary series in the visualization. The settings in this section let you choose the secondary value for comparison, including the following:

- **Comparison Series** : Choose a measure from the Explore to set as a comparison series. The value of the selected measure will be the value that is compared against the [primary value](https://docs.cloud.google.com/looker/docs/2622/kpi-single-value-options.md.txt#primary-value).
- **Comparison Row** : Specify a row's value from the **Comparison Series** to display. Options include **1st** , **2nd** , **Last** , and **Total** (when [**Totals** are enabled](https://docs.cloud.google.com/looker/docs/2622/creating-and-editing-explores.md.txt#displaying_totals)). **1st** is selected by default.
- **Value Labels** : You can specify how the comparison series is used in the visualization. The options include the following:
  - **Show as Value**: The value of the comparison series is displayed.
  - **Show as Change** : The value of the comparison is displayed, with conditional formatting to indicate the type of change compared to the primary series. If the change in value is negative, a triangle points downwards. If the change in value is positive, the triangle points upward. By default, a negative number appears in red with a red triangle, and a positive number appears in green with a green triangle. These colors can be switched by turning on the **Positive Values are Bad** setting.
  - **Show as Percentage Change** : The value of the comparison series is displayed with the percentage change compared to the primary series, with conditional formatting that indicates the type of change. If the percentage change in value is negative, a triangle points downwards. If the percentage change in value is positive, the triangle points upward. By default, a negative percentage appears in red with a red triangle, and a positive percentage appears in green with a green triangle. These colors can be switched by turning on the **Positive Values are Bad** setting.
  - **Calculate Progress**: The value of the primary field is divided by the comparison field's value, and the percentage appears as a progress bar.
  - **Calculate Progress (with Percentage)** : The value of the primary field is divided by the value of the comparison field. The percentage appears as a progress bar that is labeled with the percentage and the value of the comparison field, such as "83% of $347.8 K". If the **Show Label** setting is on, then the progress bar also shows the label for the comparison field, such as "83% of $347.8 K Monthly target".
- **Progress Bar Width** : You can specify the width of the progress bar in the chart. The options include **Full Width** or **Compact**.
- **Progress Bar Color** : You can customize the color of the progress bar with the following settings:
  - To pick a color from a palette, click the **Palettes** tab of the color picker menu, and then use the left and right arrows to scroll through the available palettes. Select a color by clicking on a color in one of the palettes.
  - To select a custom color, click the **Custom** tab of the palette picker, and then either use the color gradient and value slider to choose a custom color, or enter an RGB [hex string](https://www.w3schools.com/colors/colors_hexadecimal.asp), such as `#2ca6cd`, or [CSS color name](https://www.w3schools.com/cssref/css_colors.asp), such as `mediumblue`, into the input field.
- **Show Label** : Turn on this setting to show a label for the comparison field. By default, the label is the name of the comparison field. If you want to display a different label, enter a new label in the **Label** field.

#### Value Format

You can specify the format of the value, independent of the underlying dimension or measure. The field accepts Excel-style formatting. If no formatting is specified, the value displays in the format of the underlying dimension or measure.

MS Excel's complete guide details how to specify these formats [in their documentation](https://support.office.com/en-us/article/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5). However, color formatting is not currently supported in Looker.

> [!TIP]
> **Tip:** For Looker developers: The formatting that's used in the **Value Format** field is the same as the formatting that's used with the [`value_format` LookML parameter](https://docs.cloud.google.com/looker/docs/2622/reference/param-field-value-format), except that the `value_format` parameter requires the formatting string to be enclosed in double quotes. In the **Value Format** field, the formatting string isn't enclosed in quotes.

The [Adding custom formatting to numeric fields](https://docs.cloud.google.com/looker/docs/2622/custom-formatting.md.txt#custom_formatting_examples) documentation page provides more information on how to use custom formatting.

### Formatting menu options

Turn on **Enable Conditional Formatting** to define rules that color code your visualization by specifying values that are of interest.

#### Colors Collection

A collection lets you create themed visualizations and dashboards that look good together. All of Looker's built-in color collections appear on the [Color collections](https://docs.cloud.google.com/looker/docs/2622/color-collections.md.txt) documentation page. Your Looker admin may also create a custom color collection for your organization.

You can choose a color collection from the **Colors Collection** menu. The palettes that appear for the color swatches in each rule come from that collection.

#### Include Null Values as Zero

Turn on the **Include Null Values as Zero** setting to have Looker treat null values as zero. Including null values as zero helps to eliminate mathematical errors in calculations, avoids gaps in your visualizations, and ensures accurate metric aggregation.

#### Multiple rules

You can have multiple rules for conditional formatting. To add a rule, follow these steps:

1. To add a rule, click **Add Rule**.
2. If you have more than one rule, the rules that are higher on the list have precedence over the rules that are lower on the list. To change the precedence of a rule, click the rule's drag handle and drag the rule higher or lower in the list.
3. To delete a rule, click **Delete Rule**.

#### Format

For each rule, use the **Format** menu options to select one of the following rule options:

- **between**
- **equal to**
- **greater than**
- **less than**
- **not between**
- **not equal to**
- **not null**
- **null**

Then, enter comparison values into the text fields that appear, based on your selection. When you enter values into the rule, don't use thousands separators.

> [!NOTE]
> **Note:** Format value ranges such as **between** , **not between** , **greater than** , and **less than** are exclusive of the numbers that are listed at the boundaries of that range. For example, if you set a rule with a range **If value is between 9 and 14**, the rule applies to values 10 through 13.

#### Styles

Click the color swatches next to **Background color** or **Font color** to open the color picker menu, which lets you pick or customize a color:

- To pick a color from a palette, click the **Palettes** tab of the color picker menu, and then use the left and right arrows to scroll through the available palettes. Select a color by clicking on a color in one of the palettes.
- To select a custom color, click the **Custom** tab of the palette picker, and then either use the color gradient and value slider to choose a custom color, or enter an RGB [hex string](https://www.w3schools.com/colors/colors_hexadecimal.asp), such as `#2ca6cd`, or [CSS color name](https://www.w3schools.com/cssref/css_colors.asp), such as `mediumblue`, into the input field.

## Related resources

Now that you know how to create a KPI (Single Value) visualization in Looker, you may want to learn how to do the following:

- [Save Explore queries as Looks](https://docs.cloud.google.com/looker/docs/2622/saving-and-editing-looks).
- [Add Explore queries to dashboards](https://docs.cloud.google.com/looker/docs/2622/creating-user-defined-dashboards.md.txt#creating_a_dashboard_from_a_look_or_an_explore).
- [Share data](https://docs.cloud.google.com/looker/docs/2622/sharing-data) with other users.