Dimensions and Measures, Blue and Green
Tableau identifies each field as a dimension or measure in the Data pane, depending on the type of data the field contains. You use these fields to build your analysis.
About data field roles and types
Data fields are made from the columns in your data source. Each field is automatically assigned a data type such as integer, string, or date, and a role: a discrete dimension or continuous measure (or less commonly, a continuous dimension or discrete measure).
- Dimensions contain qualitative values (such as names, dates, or geographical data). You can use dimensions to categorize, segment, and reveal the details in your data. Dimensions affect the level of detail in the view.
- Measures contain numeric, quantitative values that you can measure. Measures are aggregated by default. When you drag a measure into the view, Tableau applies an aggregation on the field.
Blue versus green fields
Tableau represents data differently in the view depending on whether the field is discrete or continuous). Continuous and discrete are mathematical terms.
- Continuous means "forming an unbroken whole, without interruption". These fields are colored green. When a continuous field is put on the Rows or Columns shelf, an axis is created in the view.
- Discrete means "individually separate and distinct." These fields are colored blue. When a discrete field is put on the Rows or Columns shelf, a header is created in the view.
Possible combinations of fields in Tableau
This table shows examples of what the different fields look like in the view.
Discrete Dimensions | |
Continuous Dimensions (dimensions with a data type of String or Boolean can’t be continuous) | |
Discrete Measures | |
Continuous Measures |
Note: With a cube (multidimensional) data source, the options for changing data roles are limited. In Tableau Desktop, cubes are supported only on Windows.) You can change some measures from continuous to discrete, but in general, you can’t change data roles for fields in cube data sources. For related details, see Cube Data Sources.
A visual cue when a field is a measure is that the instance of the field in the view is aggregated with a function, indicated before the field name, such as: . To learn more about aggregation, see List of Predefined Aggregations in Tableau and Aggregate Functions in Tableau.
But there are exceptions:
- If the entire view is disaggregated, then by definition no field in the view is aggregated. For details, see How to Disaggregate Data.
- If you’re using a multidimensional data source, fields are aggregated in the data source and measures fields in the view don’t show that aggregation.
- And dimensions can sometimes be aggregated with specific aggregations such as MAX or ATTR.
Note: You can set the default aggregation and other properties and settings for fields. For details on customizing the fields in the Data pane, see: Organize and Customize Fields in the Data Pane, Edit Default Settings for Fields and Work with Data Fields in the Data Pane.
Examples of continuous and discrete fields used in a view
In the example on the left, because the Quantity field is Continuous, it creates a horizontal axis along the bottom of the view. The green field and the axis help you to see that it's a continuous field.
In the example on the right, the Quantity field is Discrete. It creates a horizontal headers instead of an axis. The blue field and the horizontal headers help you to see that it's discrete.
Continuous | Discrete | |
In both examples, the Sales field is set to Continuous. It creates a vertical axis because it's continuous and on the Rows shelf. If it was on the Columns shelf the axis would be horizontal. The SUM aggregation indicates that it's a measure.
The absence of an aggregation function in the Quantity field name indicates that it's a dimension.
Dimension fields in the view
When you drag a discrete dimension field to Rows or Columns, Tableau creates column or row headers.
Often, fields from the Dimension area are discrete when you add them to a view, with a blue background. Date dimensions and numeric dimensions can be discrete or continuous, and all measures can be discrete or continuous.
After you drag a dimension to Rows or Columns, you can change the field to a measure by clicking the field and choosing Measure. Now the view contains a continuous axis instead of column or row headers, and the field is green:
Date dimensions can be discrete or continuous. Dimensions containing strings or Boolean values can’t be continuous.
Tableau doesn’t aggregate dimensions. For a discussion of the different types of aggregation Tableau can perform, see List of Predefined Aggregations in Tableau.
In Tableau queries, dimensions in the view are expressed in SQL as "Group By" clauses.
For details on converting fields between continuous and discrete, see Convert Fields between Discrete and Continuous.
How dimensions affect the level of detail in the view
The level of detail in a view refers to how granular the data is given the dimension and measure data in the view.
As you add dimensions to Rows or Columns, the number of marks in the view increases.
To understand why adding dimensions increases the number of marks in the view, do the following:
-
Drag Segment to Columns.
The status bar at the bottom of the Tableau window shows you that there are now three marks in the view:
Those marks contain placeholder text,
Abc
, because you’re only building the view's structure at this point. -
Drag Region to Columns.
Now there are 12 marks. Three values in Segment multiplied by four values in Region is 12.
-
Drag [Ship Date] to Rows.
The total is now 57 marks (three segments by four regions by five years is 60, but three possible combinations have no data).
We could continue adding dimensions to Rows and Columns to see the number of total marks continues to increase. Encoding a dimension by a property on the Marks card (such as Color or Size) increases the number of marks without adding headers. This use of dimensions to determine the breakdown of marks is known as setting the level of detail.
Adding a dimension to any of the following locations in Tableau affects the level of detail:
-
The view now contains 57 separate instances of
Abc
—the view is all structure and no content. Drag Sales to Text to see the values. The view can now be considered complete:
Notes
- Sometimes, adding a measure to the view can increase the number of marks in the view. For example, with Sales on Rows, the number of marks is 57. But if Profitis also put on Rows, the number of marks increases to 114. But this isn’t the same as changing the view's level of detail.
- The number of marks in the view isn’t always the same as multiplying the number of members of each dimension. There are multiple reasons why the number of marks could be lower. To force a mark to show for every possible combination you can Show Missing Values. For more information about how to show missing values, see Show or Hide Missing Values or Empty Rows and Columns.
Measure fields in the view
When you drag a measure to the view, it’s aggregated by default. The type of aggregation varies depending on the type of view. Always check the aggregation and change it if necessary. For details, see "Change the default aggregation" in Edit Default Settings for Fields. For more details about aggregation, see Data Aggregation in Tableau.
When you drag a continuous field from the Data pane to Rows or Columns, Tableau creates a continuous axis for that field.
If you click the field and change it to Discrete, the values become column headers.
Tableau continues to aggregate values for the field, because even though the field is now discrete, it’s still a measure, and Tableau aggregates measures by default.
In cases where Tableau has misclassified a field as a dimension or a measure, possibly because of the data type, you can convert it and change its role. If a measure doesn't need to be aggregated (such as numeric IDs), convert the field to a dimension.
For related details, see Convert a Measure to a Dimension.
For details on converting fields between continuous and discrete, see Convert Fields between Discrete and Continuous.
How continuous and discrete fields change the view
Continuous and discrete are mathematical terms. Continuous means "forming an unbroken whole, without interruption"; discrete means "individually separate and distinct."
In Tableau, fields can be either continuous or discrete. When you drag a field from the Data pane to Columns or Rows, the values are continuous by default and Tableau creates an axis. When you drag a field from the Data pane to Columns or Rows, the values are discrete by default and Tableau creates column or row headers.
Continuous fields produce axes
If a field has values that are numbers that can be added, averaged, or otherwise aggregated, it’s added as a measure field in the Data pane when you first connect to a data source. Tableau is assuming that the values are continuous.
Tableau displays an axis when you drag a continuous field to Rows or Columns. An axis is a measuring line that shows values between a minimum and a maximum. Rulers and analog thermometers are examples of physical objects that display axes.
While there are value labels on a continuous axis (0, 0.5, ... 3.0 in the following image), actual marks don't have to align with these tick marks. For example, in the following image, the blue bar actually extends to a value of 6.940 on the horizontal axis, not 7.0 exactly.
The number of potential values for continuous fields is impossible to anticipate. For example, if you have a field named Ratings and the initial values are 1, 3, 3.5, 3.6, and 4, that's five distinct values. But if you bring Ratings to Rows, the aggregated value is a sixth value (3.02) that didn't exist until you added the field to the view. And if you then applied a filter that eliminated two of the initial values, the average changes to a different value. And then if you changed the aggregation, ... You get the idea. The number of potential values is, if not infinite, then immense.
The fact that a field contains numbers doesn’t automatically indicate that those values are continuous. Postal codes are the classic example: though they’re often composed entirely of numbers, they’re actually string values that shouldn't be added or averaged. If Tableau assigns such a field as a measure to the Data pane, drag it to a dimensions area to change it to a dimension.
Discrete fields create headers
If a field contains values that aren't numbers, it's identified as a dimension in the Data pane. Tableau treats the values as discrete.
Tableau creates headers when you drag a discrete field to Columns or Rows. The individual values for a discrete field become the row or column headings.
Discrete versus continuous fields on filters
- When you drop a discrete dimension field on the Filters shelf, Tableau prompts you to choose which members of the discrete field to include in the view.
- When you drop a Date field on Filters, the result can be a discrete filter or a continuous filter. For more information, see Filter dates (Link opens in a new window).
- When you drop a continuous measure on Filters, Tableau first prompts you to choose an aggregation for the filter.
- When you drop a continuous dimension on Filters (other than a Date), Tableau prompts you to specify how to filter the continuous range of values.
For more on filtering various types of fields, see Drag dimensions, measures, and date fields to the Filters shelf (Link opens in a new window).
Discrete versus continuous fields on color
When you drop a discrete field on Color in the Marks card, Tableau displays a categorical palette and assigns a color to each value of the field.
When you drop a continuous field on Color, Tableau displays a quantitative legend with a continuous range of colors.
For more information about color palettes, see Color Palettes and Effects.