How to Aggregate Data in Tableau

Cody Schneider8 min read

Dragging your fields into Tableau only to see confusing numbers is a common hurdle when you’re starting out. The answer usually lies in understanding aggregation, a core concept that turns messy, row-level data into meaningful summaries. This article will walk you through what data aggregation is, how Tableau handles it automatically, and how you can take control to build the reports you need.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

What is Data Aggregation?

In simple terms, data aggregation is the process of taking many individual data points and summarizing them into a single, representative value. Think about a spreadsheet of every single sale your business made this year. It might have thousands of rows, with each row representing one transaction. While this is great for detail, it’s not very useful for seeing the big picture.

Aggregation is what lets you answer questions like:

  • What were our total sales for the year? (SUM)
  • What was the average price of an item sold? (AVERAGE)
  • How many unique customers did we have? (COUNT DISTINCT)
  • What was our biggest single sale? (MAX)

Instead of looking at thousands of individual sales, you're looking at condensed, summary figures. Tableau is built to do this automatically to help you make sense of large datasets quickly.

To really get a handle on this, it's helpful to understand the two main types of data fields in Tableau: Measures and Dimensions.

  • Measures: These are your numbers - quantitative data that you can perform mathematical operations on. Think Sales, Quantity, Profit, or Website Sessions. Tableau will almost always try to aggregate a measure when you bring it into your view.
  • Dimensions: These are your categories - qualitative data that provides context. Things like Product Category, Region, Customer Name, or Date. You can’t sum up "Region," but you can sum up "Sales" by "Region." Dimensions set the level of detail for your aggregation.

The relationship is simple: Measures get aggregated, and dimensions define the groups to aggregate them by.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Tableau’s Default Aggregation

One of the best things about Tableau is that it tries to be helpful right from the start. When you drag a measure onto your view (like onto the Rows shelf or into the Text mark), Tableau doesn’t show you every single value from your source data. Instead, it automatically applies an aggregation. Most of the time, the default is SUM.

Let's use a sample dataset of online store sales. If your data has a 'Sales' column, and you drag it onto the Text mark on the Marks card, you won't see a list of every sale. You’ll see a single number: the sum of all sales in your entire dataset.

Tableau visibly tells you what aggregation it's using. On the shelf, the field will look something like this: SUM(Sales). That "SUM()" wrapper indicates that the Sales field is being summed up.

This behavior is fundamental. When you want to see sales broken down, you add a dimension. For example, if you drag the 'Region' dimension to the Rows shelf, Tableau will now calculate SUM(Sales) for each region separately.

How to Change the Aggregation in Tableau

While SUM is the default for most numeric fields, it’s not always what you need. You might be more interested in the average sale, the total number of transactions, or the median order value. Changing the aggregation is one of the most common actions you'll take in Tableau.

Let's walk through an example. Imagine you want to see the average sales per customer instead of the total.

Step-by-Step Guide:

  1. Start with a clean sheet. From the Data pane, drag your dimension (e.g., Customer Name) onto the Rows shelf. You'll see a list of all your customer names.
  2. Now, drag your measure (e.g., Sales) onto the Columns shelf. Tableau will create a bar chart showing the SUM(Sales) for each customer by default. You can see the pill on the Columns shelf reads SUM(Sales).
  3. To change this, right-click on the SUM(Sales) pill on the Columns shelf.
  4. In the context menu that appears, hover your cursor over the "Measure" option. You’ll see a checkmark next to "Sum."
  5. Select a different aggregation from the list, such as "Average."

Instantly, your chart updates! The pill on the Columns shelf now reads AVG(Sales), and the bars have resized to reflect the average sale for each customer, not the total. It's that simple.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Common Aggregation Functions and When to Use Them

That dropdown list contains several powerful options. Here are the most common ones and what they're good for:

  • Sum: The total of all values. Perfect for KPIs like Total Revenue, Total Pageviews, or Total Units Sold.
  • Average: The mean value. Use this for things like Average Order Value (AOV), Average Session Duration, or Average Deal Size.
  • Median: The middle value in a set of numbers. This is useful when you have outliers that might be skewing your average. For example, if most sales are $50 but one is $5,000, the median will give you a better sense of a "typical" purchase than the average.
  • Count: The total number of rows. This is great for answering "How many transactions occurred?" regardless of the sale amount.
  • Count (Distinct) or COUNTD: The number of unique values in a field. This is one of the most powerful aggregations. Use it to find out how many unique customers made a purchase, how many different products were sold, or how many unique visitors came to your site. This avoids double-counting. For example, a single customer making 10 purchases would be counted 10 times with COUNT and only 1 time with COUNTD.
  • Minimum (MIN) and Maximum (MAX): These show you the lowest and highest values in your dataset, respectively. Useful for identifying the smallest sale, the largest deal, or the peak traffic day.

Unchecking "Aggregate Measures"

You may have noticed an option in the "Analysis" menu at the top called "Aggregate Measures." By default, this is checked. So what happens if you uncheck it?

When you disaggregate the data, you are telling Tableau to stop summarizing the numbers and instead show you a mark for every single row in your underlying data source. The SUM(), AVG(), etc. wrappers will disappear from your pills.

This is most commonly used when building scatter plots. Imagine you want to compare Sales vs. Profit for every individual order. To do this, you would:

  1. Drag Sales onto the Columns shelf.
  2. Drag Profit onto the Rows shelf.
  3. Go to the Analysis menu and uncheck "Aggregate Measures."

Instead of a single point in your view representing the total sum of sales vs. the total sum of profit, you will see a cloud of points. Each point represents an individual order in your dataset, showing you the relationship between the two measures at the most granular level. For most bar charts, line charts, and tables, you'll want to keep measures aggregated. But for exploring relationships between individual data points, disaggregating is the way to go.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Creating Custom Aggregations with Calculated Fields

Sometimes, the standard aggregations aren't enough. You might need to combine them to create a custom Key Performance Indicator (KPI). For this, Tableau has calculated fields.

A calculated field lets you write your own formulas, which can include aggregations. A classic marketing example is calculating a Website Conversion Rate. Your data source likely has Sessions and Transactions, but it probably doesn't have Conversion Rate.

You can create it yourself:

  1. In the Data pane, click the little drop-down arrow at the top and select "Create Calculated Field."
  2. Give your calculation a name, like "Conversion Rate."
  3. In the formula box, you can’t just write [Transactions] / [Sessions]. This would try to perform the calculation for every single row, which is not what we want. We need to aggregate first, then divide.
  4. Your formula should be: SUM([Transactions]) / SUM([Sessions])
  5. Click "OK."

Now you have a brand-new measure in your data pane called "Conversion Rate." You can drag this into your view just like any other measure. Tableau will execute the formula, summing up all transactions, summing up all sessions, and then dividing the two totals to give you an accurate, aggregated conversion rate. You could then format this number as a percentage for a clean visualization.

Final Thoughts

Mastering data aggregation is how you transition from just dropping pills into Tableau to truly analyzing your data and building insightful reports. It's the mechanism that rolls up millions of data points into summary figures like totals and averages, all determined by the dimensions you use to slice your data.

While learning the nuances of aggregations, calculated fields, and different chart types in Tableau is a valuable skill, it often involves a steep learning curve. We created Graphed to remove this friction entirely. Instead of configuring pills and writing aggregation formulas, you can simply ask questions in plain English like, "Show me the average order value by marketing channel" or "Create a bar chart of total sales by country," and have an interactive chart built for you in seconds. It connects to all your data sources and handles the aggregation behind the scenes so you can get straight to the insights.

Related Articles