---
schema_version: "1"
id: f51671a8bc3bcb1f9ec32156a60335499d3099b121c2e59aba4fe3cf7d285de5
title: INCLUDE Level of Detail Expressions
collection: tableau
version: current
locale: en-gb
portal_url: https://docs.salesforce.com/tableau/current/en-gb/pro/desktop/calculations_calculatedfields_lod_include.md
canonical_url: https://help.tableau.com/current/pro/desktop/en-gb/calculations_calculatedfields_lod_include.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 568d6929a57becf48cf70c839402c6059bc75a365b18cb9f6e7f2691eea2e88e
description: Use INCLUDE LOD expressions to compute at a finer level and re-aggregate in the view.
---
[Skip to main content](#main-content)

# INCLUDE Level of Detail Expressions

INCLUDE level of detail expressions compute values using the specified dimensions in addition to whatever dimensions are in the view.

INCLUDE level of detail expressions can be useful when you want to calculate at a fine level of detail in the database and then re-aggregate and show at a coarser level of detail in your view. Fields based on INCLUDE level of detail expressions will change as you add or remove dimensions from the view.

## Example 1

The following INCLUDE level of detail expression computes total sales per customer:

`{ INCLUDE [Customer Name] : SUM([Sales]) }`

When that calculation is placed on the Rows shelf, aggregated as AVG, and the \[Region\] dimension is placed on the Columns shelf, the view shows the average customer sales amount per region:

![A bar chart showing the average sales per customer by region.](/tableau/current/en-gb/pro/desktop/en-gb/Img/calculations_lod_include_ex1.png)

If the \[Sales\] measure is then dragged to the Rows shelf, the result illustrates the difference between the sum of sales (somewhere between $390K and $700K per region) and the average sales per customer (between $750 and $1100 per region):

![Bar chart of average sales per customer and total sales by region.](/tableau/current/en-gb/pro/desktop/en-gb/Img/calculations_lod_include_ex1part2.png)

## Example 2

The following INCLUDE level of detail expression calculates sum of sales on a per-state basis:

`{ INCLUDE [State] : SUM(Sales)}`

Type the calculation directly on the Rows shelf, and then change the aggregation to AVG using the field's context menu. The resulting view averages the sum of sales by state across categories.

![A bar chart that displays average sales by category.](/tableau/current/en-gb/pro/desktop/en-gb/Img/calculations_lod_include_ex2a.png)

The view can be further enhanced by adding \[Segment\] to Columns and then copying the ad-hoc calculation from Rows to Label (using Ctrl+drag). In the image below we also dragged Segment to Colour and then edited the colours for aesthetic effect. Now we can see how the average sum of sales per state varies across categories and segments.

![A bar chart that shows average sales by segment and category.](/tableau/current/en-gb/pro/desktop/en-gb/Img/calculations_lod_include_ex2.png)