About dimensions and metrics
Fields contain the information that appears in your reports. There are 2 types of fields in a data source: dimensions and metrics. A dimension is a category of data, while a metric is a number that quantifies something in that category. When you add a data source to a report, its fields become available for use in charts and controls.In this article:
If you're new to data visualization and reporting, the following information may be useful.
How data is organized
A data set is organized into a tabular format of rows and columns. For example, the table below shows data from an online clothing store:
|Row||Item Name||Color||Quantity Sold|
Each row in the table contains one record, or instance, of the data; in this case, items for sale in the store.
The columns in the table make up the fields: discrete chunks of information that describe or measure the rows. Item name, Color, and Quantity Sold are fields that describe the products in your online store.
In this example, the Quantity Sold fields shows the total number of each item and color combination sold, rather than showing each individual sale. This is known as aggregation. Aggregation simplifies and summarizes information, making it easier to derive meaning from large data sets.
Dimensions describe. Metrics measure.
Dimensions are data categories. Dimension values (the data contained by the dimension) are names, descriptions or other characteristics of a category. In the example above, Item Name and Color are both dimensions: they describe or categorize the products for sale.
Metrics measure the things contained in dimensions. In Data Studio, metrics values are always aggregated: given metric X, the value can be a sum (total of all values of X), a count (how many X?), a ratio (X/sum of X), etc. See below for more on aggregation.
Metrics are always numbers. Dimensions can be any other kind of data, including unaggregated numbers, dates, text, and boolean (true/false) values.
Dimensions and metrics in your data source
When you connect to your data in Data Studio, columns in the underlying data set become fields in your data source. Dimensions (unaggregated data) appear as green fields. Metrics (aggregated data) appear as blue fields.
Calculated fields appear with fx at the end. You can add calculated fields after the data source has been created. These can be either dimensions or metrics.
Configure data source fields
The image below shows the data source editor, and illustrates how fields in a data source are configured.
- Data source name (click to edit)
- Edit data source connection (available to data source editors only)
- Create calculated field button
- Fields (by row number):
- Calculated dimension
- Regular dimension
- Calculated metric
- Regular metric
Default field names come from your data set. Click a field name to edit it.
If the name is too long to display completely, hover over it until the full name appears.
The Type property tells Data Studio what kind of data to expect when processing the field. A field's type determines how the data appears in your reports, which operations are allowed for it, and which are not. For example, you can't apply an arithmetic function to a Text field, or use a Number field as the date range dimension in a report.
The table below shows the supported field types, along with the kind of data expected as input, and examples of how that data might look in your reports.
|Type||Expected data||Report examples|
|Number||A floating point number.||1,234.56|
|Percent||A floating point number representing a ratio.||61.73%|
|Duration||An integer representing a time duration in seconds. This will be formatted into a standard time display in reports.||01:43:19|
|Currency||A floating point number representing a monetary value. This will be formatted to include the appropriate currency symbol in reports.||$1,234.56|
|Text||Zero or more letters, numbers, characters, or symbols.||
|Date & Time||
An actual calendar date, or an abstract date index. This will be formatted according to the locale, and to the Show As display setting in reports.
Learn more about working with dates.
A logical value.
If the data set doesn't provide boolean values, you can create a Boolean field using a calculated field with the CASE statement:
A value representing a geographic region, such as a country name, latitude and longitude, ISO code, or Google Ads criteria ID.
Learn more about visualizing geographic data.
An address of a World Wide Web page.
|Hyperlink||A clickable link to a URL. Hyperlink fields are created by the HYPERLINK function.||See an example of Hyperlink fields|
|Image||An image. Image fields are created by the IMAGE function.|
|Image Link||A clickable image. Image Link fields are created by the HYPERLINK function.||See an example of Image Link fields|
To change the field type, use the Type drop-down menu in the data source edit page. If the field editing in reports option is enabled for the data source, you can also change field types directly in reports based on this data source.
Text, will convert the metric into a dimension. This might have adverse affects on charts or formulae that expect the field to be a metric, so be careful doing this.
The Aggregation property determines how a field is summarized in charts. Data Studio supports the following aggregation methods:
|Sum||The field values are added together.|
|Average||The field values are averaged.|
|Count||Every value is counted.|
|Count Distinct||Only unique values are counted.|
|Min||The field displays the minimum value.|
|Max||The field displays the maximum value.|
|None||No aggregation is applied. The field is treated as a dimension, even if it contains numeric data.|
To change the field's aggregation method, use the Aggregation drop-down menu in the data source edit page. If the field editing in reports option is enabled for the data source, you can also change the aggregation method directly in reports based on this data source.The Field editing in reports option also lets you change the directly in reports based on this data source.
If a field's aggregation is set to
Auto, it means the field has already been aggregated in the underlying data set. You can't change this in Data Studio.
The "More" menu lets you perform additional actions on a field. To access this menu:
- Locate the field you want to act on
- To the right of the field, click
- Select the action to perform:
|Count||Create a new metric by applying the COUNT function to the selected dimension.|
|Count Distinct||Create a new metric by applying the COUNT DISTINCT function to the selected dimension.|
|Duplicate||Create a copy of the field.|
|Enable||Prevent report editors from using this field in reports.|
Allow report editors to use a previously disabled field.
|Remove||Delete a calculated field.|