top of page

Level of Detail (LOD) in Tableau: A beginner’s guide

In today’s blog we will learn about what is Level of detail expression in tableau with some basic examples from Superstore Dataset. This blog will help you understand about LOD calculations in tableau.

What is LOD in Tableau?

Level of Detail (LOD) refers to the granularity or level of aggregation at which calculations are performed in Tableau. It allows analysts to specify the level at which they want to analyze and summarize data. LOD in Tableau is particularly useful when dealing with complex datasets that contain different dimensions and measures.

By using LOD expressions analysts can gain more precise insights and answer specific business questions by defining the level at which calculations should occur. LOD expressions help create custom aggregations, segment data, and perform complex calculations that go beyond the default aggregations provided by Tableau. 

What are the types of Level of Detail expressions?

Image Source: Google

Tableau offers three types of Level of Detail (LOD) expressions: Fixed, Include, and Exclude. Each type serves a different purpose and allows analysts to manipulate data at specific levels of granularity. 

1)    Fixed LOD expressions:

These LOD expressions enable analysts to calculate a value at a fixed level of granularity, regardless of the dimensions present in the view. This means that the calculation ignores the dimensions in the view and provides a consistent result.

For Example, if I want to calculate Category wise sales then I wrote a formula named Fixed_Category as the screenshot below:

Image from Author

This mean this formula has created for sales at Category Granular level, if I include any other dimension in the view, the result will be same for all for more granular level( here I choose Sub_category as more granular level).

  Image from Author

In this Screenshot, though I included Sub_Category in the Rows but FIXED LOD calculation is giving same bar length for same category ignoring the Sub_category.

2) Include LOD expressions

These expressions allow analysts to calculate a value at a specified level of granularity while still including additional dimensions in the view. INCLUDE is a slightly more advanced type of LOD.  An Include LOD looks at all of the dimensions in your chart, and adds another dimension to the list. This enables a more detailed analysis while retaining the desired level of aggregation. This will include the dimension present in the view with the dimension specified by the user. Hence INCLUDE LOD works at the lower level of granularity.

For Example. If I want to see Sales for the largest Sub-category within each region in the view, then create a calculated field formula same as the below screenshot.

Image by author

Now drag the Region and Category to Rows and for showing the sales for highest category under each Region and Category we can drag the above Include calculation in the Text under the Marks and change the aggregation to Max.

· Let’s drag our created calculated field to the Rows you will get two bar charts

· But to get the Maximum sales by the Sub category, right click on “SubCategorySales”

  • Select the “Measure” option

  • Click on the “Maximum” option in the drop-down

Image by author

Also, drag the same to color shelf to get a better Visualization.

Image by author

So, in this above visualization, we are getting highest sub-category sales for each category and Region. Also, verifying the result with below chart.

Image by author

3) Exclude LOD expressions

These expressions enable analysts to calculate a value at a specified level of granularity, excluding specific dimensions from the calculation. This allows for a more refined analysis by removing certain dimensions from consideration. In simple words, EXCLUDE works the exact opposite of INCLUDE.  It removes a dimension that currently exists in your visualization.

For example, If I want to see the Total Sales for Region, Category, Sub-Category wise and Total Sales for Region and Category wise excluding Sub_Category in the same visualization we can achieve this by EXCLUDE LOD.

First write a calculated field as the below screenshot:

Image by author

Then drag Region, Category, Sub_category in the ROWS shelf and Sum of Sales and Sum of sales excluding Sub_Category formula in the Measure Values as shown in the screenshot.

Image by author


Final conclusion from this above explanation are that FIXED LODs are designed to work independently of the chart.  Therefore, their values are not affected by filters or adding any more dimension in the Viz but INCLUDE and EXCLUDE LOD's are designed to work in the confines of a single viz.  Therefore, they are affected by filters.

Best practices for working with LOD in Tableau :

  1. Clearly define your analysis objective before using LOD in Tableau. Understand the question you want to answer or the insight you seek.  

  2. Start with simple Level of Detail expressions and gradually build upon them. This approach ensures accuracy and easier troubleshooting. 

  3. Test and validate your Level of Detail expressions against known data points or calculations to ensure accuracy and consistency. 

  4. Use descriptive naming conventions to keep Level of Detail expressions organised and easily identifiable. 

We still have a lot more to explore this new feature of Level of Detail Calculations.  Thanks for reading this blog. Hope you found this informative.


95 views0 comments


Oceniono na 0 z 5 gwiazdek.
Nie ma jeszcze ocen

bottom of page