How to Change Aggregation in Tableau
Working with data in Tableau often means summarizing it, and that's where aggregation comes in. By default, Tableau will automatically try to sum up your numbers, but that's not always the story you want to tell. This article will walk you through how to change the aggregation method for your data, from totals to averages and beyond, putting you in full control of your visualizations.
What is Aggregation, Anyway?
In the simplest terms, aggregation is the process of taking many individual data points and boiling them down into a single summary value. Think of it as a way to see a high-level picture instead of getting lost in a sea of raw numbers. Tableau does this automatically to make your data more manageable and understandable at a glance.
For example, if you have a spreadsheet with a thousand individual sales transactions, you probably don't want to see a chart with a thousand separate bars. Instead, you might want to know:
- Total Sales: This is a
SUM()aggregation. It adds up all the sale amounts. - Average Sale Price: This is an
AVG()aggregation. It calculates the average value across all sales. - Number of Unique Customers: This is a
COUNTD()(Count Distinct) aggregation. It counts how many individual customers made purchases, ignoring duplicates. - Highest Sale: This is a
MAX()aggregation. It finds the single largest transaction value.
Every time you drag a numerical field - what Tableau calls a "Measure" - onto your view, Tableau instantly applies an aggregation to it. The beauty is that you have complete control to change this aggregation to fit your specific analysis goal.
The Two Sides of the Pill: Measures and Dimensions
Before changing aggregations, it's helpful to understand one of Tableau's most fundamental concepts: the difference between Measures and Dimensions. When you connect to a data source, Tableau categorizes your fields into one of these two types.
Dimensions: The "Who, What, Where"
Dimensions are qualitative fields that you use to slice and dice your data. They set the context and provide categories for your analysis. Think of fields like:
- Customer Name
- Product Category
- Region
- Order Date
In a Tableau worksheet, dimension pills are typically blue. When you drag a dimension onto the view (like onto the 'Rows' shelf), it creates headers or labels. For example, dragging Product Category to Rows would create a list of your categories: "Furniture," "Office Supplies," and "Technology."
Measures: The "How Much"
Measures are the quantitative, numerical fields you want to analyze. These are the numbers you can perform calculations on. Examples include:
- Sales
- Profit
- Quantity
- Number of Clicks
In a Tableau worksheet, measure pills are typically green. When you drag a measure onto the view (like onto the 'Columns' shelf), Tableau doesn't list out every single number. Instead, it aggregates it. If you drag Sales to Columns, Tableau automatically creates an axis based on the SUM(Sales). This default aggregation is what we're going to learn how to change.
How to Change Aggregation Directly on a Pill
The quickest way to change the aggregation of a measure is right within your worksheet. Let's say you've built a simple bar chart showing sales by region.
- You drag the
Regiondimension to the Rows shelf. - You drag the
Salesmeasure to the Columns shelf.
By default, the pill on the Columns shelf will say SUM(Sales), and your chart will show the total sales for each region. But what if you want to see the average sale size per region instead? Here’s how you change it:
Step 1: Locate the Measure Pill
Find the green SUM(Sales) pill on your Columns, Rows, or Marks card.
Step 2: Open the Context Menu
You can do this in two ways:
- Right-click on the
SUM(Sales)pill. - Click the small down-arrow that appears on the right side of the pill when you hover over it.
Step 3: Select a New Aggregation
In the menu that appears, hover your cursor over the option that says "Measure(Sum)". This will open a sub-menu listing all the available aggregation types:
- Sum: The total of all values.
- Average: The mean value.
- Median: The middle value in your dataset.
- Count: The total number of records/rows.
- Count (Distinct): The number of unique values. For example,
COUNTD(Customer ID)would give you the number of unique customers. - Minimum: The lowest value.
- Maximum: The highest value.
- Percentile: The value at a specific percentile of your data.
- Std. Dev (Standard Deviation): A measure of data spread.
- Variance: The square of the standard deviation.
Click on "Average". The pill on your shelf will immediately change to AVG(Sales), and your bar chart will update to show the average sale value for each region. Just like that, you've completely changed the story your visualization tells.
Setting a New Default Aggregation for a Measure
Sometimes, you might find yourself constantly changing a field from SUM to something else. For example, maybe your primary interest in "Customer Rating" is its average, not its sum. Summing up customer ratings doesn't really make sense. You can save yourself a few clicks by changing the default aggregation for that specific measure.
Here’s how to do it:
Step 1: Find the Measure in the Data Pane
Go to the Data pane on the left side of your screen, where all your data sources and fields are listed. Find the measure whose default you want to change (e.g., Customer Rating).
Step 2: Open the Default Properties Menu
Right-click on the measure field in the Data pane.
Step 3: Change the Default Aggregation
In the context menu, hover over "Default Properties" and then move your cursor over to "Aggregation" in the sub-menu.
Step 4: Select the New Default
From the list of available aggregations, click "Average".
That's it. Nothing will change on your current worksheet, but now every time you drag the Customer Rating field into a view, it will default to AVG(Customer Rating) instead of SUM(Customer Rating). This small change can make your workflow significantly smoother.
Disabling Aggregation To See Raw Data
What if you don’t want an aggregation at all? Say you want to see individual data points for each transaction on a scatter plot, not just summary values. In this case, you can completely turn off Tableau’s aggregation feature.
When to Disable Aggregation?
- When building scatter plots that show individual data points.
- When you want to identify individual outliers in your data.
- When your data is pre-aggregated, and you want to show the exact values from your data source.
There's a single setting that manages this for any unitary worksheet:
Step 1: Go to the Analysis Menu
At the top of the Tableau window, click on "Analysis" in the main menu bar.
Step 2: Uncheck "Aggregate Measures"
In the drop-down menu, you'll see a checkmark next to "Aggregate Measures". Click it to uncheck it.
What happens next? When you disable aggregation, every row in your data source gets represented as an individual mark in your view. The axis and pills will change. For example, SUM(Sales) will become just Sales, and the axis will show a range that covers all your individual sales, not the total sum.
Be careful: Disabling aggregation can impact performance, especially if your data source has hundreds of thousands or millions of rows. Tableau will have to render a mark for each single row, which can slow things down.
Final Thoughts
Mastering aggregation in Tableau is a fundamental step in moving from basic charts to meaningful insights. Whether you've changed a sum to an average because summing ratings doesn't make sense, set a new default to speed up your workflow, or disabled it altogether to see your raw data, you now have the tools to shape your data story the way you want.
We spend a lot of time helping our customers get insights from their marketing and sales data, and one of the biggest hurdles in building dashboards with traditional BI tools is the steep learning curve involved with mastering concepts like aggregation. That's why we built Graphed to use natural language to turn descriptions like 'show me an average sale value per quarter' into live dashboards in seconds! Instead of right-clicking pills and navigating menus, you just ask a question and get the chart you need without any manual configuration or BI tool expertise.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.