---
schema_version: "1"
id: 8321586d43ef72f5ed9afd32874b9d58fd40cf5a74dde404aab7a90a3a3fb4e3
title: INCLUDE Level of Detail Expressions
collection: tableau
version: next
locale: en-gb
portal_url: https://docs.salesforce.com/tableau/next/en-gb/pro/desktop/calculations_calculatedfields_lod_include.md
canonical_url: https://help.tableau.com/v0.0/pro/desktop/en-gb/calculations_calculatedfields_lod_include.htm
source_site: help.tableau.com
content_type: documentation
content_hash: e3b8f21ad840b2f123edc02b812af86ed1223222ce9fb5e7d689d76c3e8df102
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/next/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/next/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/next/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/next/en-gb/pro/desktop/en-gb/Img/calculations_lod_include_ex2.png)