In Tableau, Level of Detail (LOD) expressions allow you to specify the level of granularity at which you want to perform calculations. LOD expressions can allow you to perform calculations that are either independent of, or dependent on, the level of detail in the view.
In this blog post, we will focus on Include and Exclude LODs. Include and Exclude LODs allow you to specify the dimensions that you want to include or exclude in your calculations, and they can be very useful in scenarios where you want to perform calculations that are based on a specific set of dimensions.
Include LODs
Include LODs allow you to perform calculations that include only the dimensions that you specify in the LOD expression. For example, suppose you have a dataset containing sales data for multiple products and regions, and you want to calculate the average sales per region. You can use an Include LOD to perform this calculation as follows:
This LOD expression will calculate the average sales per region, including only the Region dimension in the calculation.
Exclude LODs
Exclude LODs are similar to Include LODs, but they allow you to perform calculations that exclude the dimensions that you specify in the LOD expression. For example, suppose you have a dataset containing sales data for multiple products, regions, and categories, and you want to calculate the average sales per category, excluding the Region dimension. You can use an Exclude LOD to perform this calculation as follows:
This LOD expression will calculate the average sales per category, excluding the Region dimension from the calculation.
When to use Include and Exclude LODs
Include and Exclude LODs can be very useful in scenarios where you want to perform calculations that are based on a specific set of dimensions, or where you want to exclude certain dimensions from your calculations. For example, you can use Include LODs to calculate the average sales per region for a specific product, or you can use Exclude LODs to calculate the average sales per category for all regions.
Order of Operations
It’s important to note that Include and Exclude LODs are calculated after all other calculations in Tableau. This means that they are applied after dimensions, measures, filters, and aggregations have been evaluated. As a result, Include and Exclude LODs are often used to fine-tune calculations that have already been performed at a higher level of granularity. For example, you might use an Include LOD to calculate the average sales per region for a specific product after you have already filtered the view to include only that product. By understanding the order in which calculations are performed in Tableau, you can effectively use Include and Exclude LODs to achieve the results you want.

Tableau Order of Operations
In summary, Include and Exclude LODs are powerful tools in Tableau that allow you to specify the dimensions that you want to include or exclude in your calculations. They can be very useful in scenarios where you want to perform calculations that are based on a specific set of dimensions, and they are a valuable addition to your toolkit as a data analyst.