Show Table of Contents
In Tableau, you can aggregate measures or dimension, though it is more typical to aggregate measures.
When you add a measure to the view, Tableau automatically aggregates its values. Sum, average, and median are common aggregations; for a complete list, see Aggregations. The current aggregation appears as part of the measure's name in the view. For example, Sales becomes SUM(Sales). Every measure has a default aggregation which is set by Tableau when you connect to a data source. You can view or change the default aggregation for a measure—see How to Set the Default Aggregation for a Measure.
You can aggregate measures using Tableau only for relational data sources. Multidimensional data sources contain data that is already aggregated. In Tableau, multidimensional data sources are supported only in Windows.
You can change the aggregation for a measure in the view from its context menu:
You can aggregate a dimension in the view as Minimum, Maximum, Count, or Count (Distinct). When you aggregate a dimension, you create a new temporary measure column, so the dimension actually takes on the characteristics of a measure.
Note: The Count (Distinct) aggregation is not supported for Microsoft Access data sources, and for Microsoft Excel and Text File data sources using the legacy connection. If you are connected to one of these types of data sources, the Count (Distinct) aggregation is unavailable and shows the remark "Requires extract." If you save the data source as an extract, you will be able to use the Count (Distinct) aggregation.
Another way to view a dimension is to treat it as an Attribute. Do this by choosing Attribute from the context menu for the dimension. The Attribute aggregation has several uses:
It can ensure a consistent level of detail when blending multiple data sources.
It can provide a way to aggregate dimensions when computing table calculations, which require an aggregate expression.
It can improve query performance because it is computed locally.
Tableau computes Attribute using the following formula:
IF MIN([dimension]) = MAX([dimension]) THEN MIN([dimension]) ELSE “*” END
The formula is computed in Tableau after the data is retrieved from the initial query. The asterisk (*) is actually a visual indicator of a special type of Null value that occurs when there are multiple values. See Troubleshoot Data Blending to learn more about the asterisk.
Below is an example of using Attribute in a table calculation. The table shows sales by market, market size, and state. Suppose you wanted to compute the percent of total sales each state contributed to the market. When you add a Percent of Total Quick Table Calculations that computes along State, the calculation computes within the red area shown below. This is because the Market Size dimension is partitioning the data.
When you aggregate Market Size as an Attribute, the calculation is computed within the Market (East, in the following image), and the Market Size information is used purely as a label in the display.