What is INCLUDE LOD in Tableau?
A Tableau feature that often leaves new users scratching their heads is the Level of Detail (LOD) expression, especially the INCLUDE statement. But once you understand how it works, it becomes a powerful tool for answering more complex business questions. This article breaks down exactly what an INCLUDE LOD expression is, when to use it, and how it differs from other LODs, all with practical examples you can start using today.
First, a Quick Primer on LOD Expressions
Before diving into INCLUDE, it's helpful to understand what Level of Detail (LOD) expressions do in general. In Tableau, the level of detail of your visualization is defined by the dimensions you drag into your view (like onto the Rows or Columns shelves).
For example, if you drag the Region dimension to Rows and SUM(Sales) to Text, the level of detail is "Region." The SUM(Sales) calculation is performed separately for each region.
LOD expressions give you the power to run aggregate calculations at a different level of detail than what's currently in your view. They let you step outside the constraints of your visualization to answer more nuanced questions. There are three types of LOD expressions in Tableau:
- FIXED: Calculates a value at a level of detail you specify, completely independent of the dimensions in your view.
- INCLUDE: Calculates a value using the view's current dimensions plus any other dimensions you specify.
- EXCLUDE: Calculates a value using the view's current dimensions, but subtracting any dimensions you specify.
This tutorial will focus on INCLUDE, which helps you add more detail to your calculations without cluttering your actual visualization.
What is an ‘Include’ LOD Expression?
An INCLUDE LOD expression computes an aggregation at a more granular level than the details currently shown in your visualization. Think of it as telling Tableau, "For this specific calculation, I know my view is organized by Region, but I also want you to consider Customer Name when you do the math."
This allows you to perform calculations at a deeper level and then bring that result back up to the higher level of your view.
The syntax for an INCLUDE LOD expression looks like this:
{ INCLUDE [Dimension 1], [Dimension 2] : AGGREGATE([Measure]) }
Breaking it down:
{ }: The curly braces signal to Tableau that this is an LOD expression.INCLUDE: This is the keyword that defines the type of LOD.[Dimension 1], [Dimension 2]: These are the dimensions you want to add to the view's level of detail for this specific calculation.: AGGREGATE([Measure]): This section specifies the aggregation you want to perform (likeSUM(Sales)orCOUNTD(Orders)) at that more granular level.
When to Use an Include LOD Expression: The "Average of a Sum" Problem
The most common and classic use case for an INCLUDE LOD is solving questions that involve multiple levels of aggregation, like finding an "average of a sum." It sounds complex, but it's a very common business question.
Imagine your manager asks: "What is the average sales total per customer in each region?"
Let's try to answer this without an LOD expression first. If you build a view with Region on Rows and pull in Sales, you can get SUM(Sales) or AVG(Sales).
SUM(Sales)gives you the total sales for the entire region. Not what we want.AVG(Sales)gives you the average sales per line item in the dataset for that region. Also not what we want.
We need to first find the total sales for each customer, and then find the average of those totals for each region. This is where INCLUDE shines.
Step-by-Step Example: Average Sales Per Customer
Let's use the Superstore sample dataset that comes with Tableau to walk through this.
1. Create the 'Sales per Customer' Calculation
First, we need to create a calculated field that forces Tableau to calculate total sales for each customer. This is our INCLUDE LOD.
- Go to Analysis > Create Calculated Field...
- Name the calculation something clear, like "Sales per Customer."
- Enter the following formula:
{ INCLUDE [Customer Name] : SUM([Sales]) }
This calculation tells Tableau: "For each data point, find the total sum of sales for that specific customer, regardless of what dimensions are in the view."
2. Build the Visualization
Now, let's use our new calculation in a view.
- Drag the Region dimension onto the Rows shelf.
- Drag your new calculated field, Sales per Customer, onto the Text card on the Marks pane.
3. Change the Final Aggregation
By default, Tableau will likely aggregate your LOD calculation as a sum, showing SUM([Sales per Customer]). This would add up every customer's total, which isn't our goal.
Here's the final, critical step:
- Right-click the
SUM([Sales Per Customer])pill in your view (on the Text card). - Go to Measure > Average.
Voila! The view now shows you the average of each customer's total sales, broken down by region. You've successfully calculated an average of a sum.
What Tableau is doing behind the scenes:
- The
INCLUDEexpression first creates a temporary list of total sales for every single customer. - Then, when you bring it into your view and set the aggregation to
AVG, Tableau takes that list and calculates the average for each Region (the dimension in your view).
INCLUDE vs. FIXED: What’s the Difference?
A very common point of confusion is when to use INCLUDE versus FIXED. They can sometimes produce similar results, but their behavior and relationship with filters are fundamentally different.
FIXED LODs are absolute. They calculate their value based only on the dimensions listed in the formula. They completely ignore the dimensions in your view. The only way to affect a FIXED LOD with a filter is to make it a "Context Filter." This makes them great for calculating values that should remain constant across your dashboard, like a benchmark or a target for the entire company.
{ FIXED [Region] : SUM([Sales]) }
If you put this calculation in a view that's broken down by State, it will show the total sales for the entire Region repeated for every state within that region.
INCLUDE LODs are relative. They calculate their value based on the dimensions in your view plus whatever dimensions you add in the formula. They are affected by regular dimension filters, so as you filter your view, an INCLUDE calculation will update accordingly.
{ INCLUDE [City] : SUM([Sales]) }
If you put this into the same view broken down by State, it won't work as you expect — the view is already more granular than State. INCLUDE is for adding detail, not removing it. But if your view was by Region, this INCLUDE would first calculate sales per city within each region, then aggregate those results (as a SUM, AVG, etc.) up to the region level.
The key takeaway:
- Use
FIXEDwhen you need a value at an exact, specified level that ignores the viz level of detail and most filters. - Use
INCLUDEwhen you need to calculate an aggregation at a level of detail that is more granular than your viz, while still respecting the viz dimensions and filters.
Practical Tips and Common Pitfalls
As you start using INCLUDE LODs, keep these pointers in mind to avoid common mistakes:
- Always Check the Final Aggregation: The most frequent error is forgetting to change the aggregation of your LOD calculation in the view itself. It will usually default to
SUM, but your analysis might requireAVG,MIN, orMAX. - Dimension Filters Matter: Remember that
INCLUDEexpressions are calculated after dimension filters are applied. If you filter out a specific customer, their sales won't be part of theINCLUDELOD's calculation. This is different fromFIXED, which ignores standard dimension filters. - Performance: LOD expressions can be more performance-intensive than standard calculations because they require Tableau to run sub-queries. On massive datasets, use them thoughtfully. If you can achieve the same result with a simpler Table Calculation, that might be a better option.
Final Thoughts
The INCLUDE Level of Detail expression is your key to answering multi-layered questions in Tableau. By allowing you to compute aggregations at a level deeper than your visualization, you can tackle complex challenges like ratios, cohorts, and the common "average of a sum" without having to manually manipulate your data outside of the tool.
Mastering concepts like LODs takes time and practice. We know this reporting grind all too well — the hours spent learning complex tools, wrestling with formulas, and manually building dashboards. That’s why we created Graphed. Our platform connects to your data sources and lets you build real-time reports and dashboards just by describing what you need in plain English. Instead of writing code, you can simply ask, "Show me the average order value by product category," and get the answer in seconds.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?