About data modeling

Configure the dimensions and metrics used in visualizations.

Modeling your data in Data Studio consists of customizing the fields contained in your data sources so that your reports visualize that data in the desired fashion. You can then share and reuse those data sources to ensure that your reports are consistent.

There are 2 types of fields in Data Studio:

  • Dimensions describe or categorize your data. Adding dimensions to a chart groups the data by those dimensions. Campaign name, Product ID, and Country are all examples of dimensions you might use to group the information in a chart. Note that any type of data can be a dimension, including a column of unaggregated numbers.
  • Metrics measure your dimensions. A metric is the result of applying an aggregation to a set of values,. That aggregation could come from the underlying data set, or be the result of implicitly or explicitly applying an aggregation function, such as COUNT(), SUM(), or AVG().

This article explains how to configure default properties for fields in the data source, and how to override those properties, if needed, in a report.

Dimensions and metrics in your data source

When you connect to your data in Data Studio, you'll see the list of fields along with their default properties, as shown below. Dimensions (unaggregated columns that you can group by) appear as green fields. Metrics (aggregated data) appear as blue fields.

Example data source diagram.

Legend:

  1. Data source name (click to edit)
  2. Edit data source connection (available to data source editors only)
  3. Create calculated field button
  4. Fields (by row number):
  1. Calculated dimension
  2. Regular dimension
  3. Calculated metric
  4. Regular metric
  1. More menu (click to perform field-level actions)
  2. Type menu (determines what kind of data the field holds)
  3. Aggregation menu (determines how the data is summarized)
  4. Description (for information only, has no effect in data sources or reports)

Default properties

All fields have the following properties, derived from the underlying data set:

Name

This is the name that appears in any chart that uses this field. If the name is too long to display completely, hover over it until the full name appears.

To change the name, click the field and type a new one.

Data type

A field's data type tells Data Studio what kind of data to expect when processing the field. Data 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.

Use the drop-down menu to change a field's data type.

Learn more about data types.

Default Aggregation

Aggregation is the method by which a field's data is summarized. A field's default aggregation method in the data source is applied when you use that field as a metric in a chart. If you use the field as a dimension, then you'll group the chart by that field instead. Report editors can change this at the chart level.

There are 3 possible default aggregations, depending on where the data comes from and how it's defined in the underlying data set:

None. This is the default aggregation for all dimensions containing non-numeric data. Fields with aggregation None are considered dimensions in Data Studio. 

You can create metrics from dimensions by applying an aggregation function in a calculated field. For example, COUNT(Customer Name) returns the number of non-unique customers in your data. You can't, however, apply math functions to non-numeric dimensions: SUM(Customer Name) returns an error.

Sum. This is the default aggregation for all dimensions containing unaggregated, numeric data. Generally, this applies to number columns from tabular data sets, such as Google Sheets, CSV files, and BigQuery tables. Fields with aggregation Sum can be used either as dimensions or as metrics in Data Studio.

Auto. This is the default aggregation for all metrics coming from the data set, the connector, or a calculated field. Auto means that field's aggregation method is fixed and can't be changed. Auto fields are always metrics in Data Studio.

Learn more about aggregation.

Description

Some data sources provide annotations, such as the underlying field name in a Google Analytics data source. You can edit the description by clicking it. Descriptions do not appear elsewhere besides the data source.

Calculated fields, type, and aggregation

Calculated fields let you create new fields derived from your data. Calculated fields appear in the field list with fx at the end.

The formula you use to create the field determines the data type and whether the result is an unaggregated dimension or an aggregated metric. For example, a formula that uses CONCAT() to build a URL from product codes creates a dimension of type Url with an aggregation of None. Or to create a Profit Margin field, you could use the formula SUM(Profit) / SUM(Sales). The field created would be a Number with an aggregation of Auto.

Learn more about calculated fields.

Dimensions and metrics in reports

Adding a data source to a report lets anyone who can edit the report use the data source fields to build charts and configure controls. These fields appear in the DATA tab of the properties panel on the right whenever you have one or more charts or controls selected. 

Report editors can use any of the fields provided by added data sources, even if they don't have view or edit access to the data source itself.

Dimensions and metrics in charts

Dimensions group data, with each dimension in a chart providing more and more granular detail. Metrics in charts are always aggregated numbers: the level of aggregation depends on the dimensions present, if any.

Learn how to add, replace, or remove fields.

For example, a table with the Country dimension and a single metric groups that metric by country. Adding the City dimension provides a further breakdown, first by country, then by city.

Charts with no dimensions, such as the scorecard or a table with all dimensions removed, display the ungrouped value of a metric.

Override default type and aggregation in charts

You can change default field definitions at the chart level in the following ways:

Use a dimension as a metric

  • Using a non-numeric dimension field as a metric applies the Count Distinct (CTD) aggregation method to that data.
  • Using a numeric dimension field as a metric applies the default aggregation that was specified in the data source, or Sum, if no default aggregation was specified.

Manually edit the field

In the properties panel, click a field's edit pencil to modify that field's definition. You can change the data type, aggregation method (for non-Auto aggregated fields), and apply comparison and running calculations.

To prevent report editors from changing these defaults, edit the data source and turn off Field Editing in Reports. Learn more about editing fields.

Was this helpful?
How can we improve it?