LOD stands for level of detail. LOD expressions as the name suggests, lets the user control the level of detail the measure is aggregrated to. Without LOD expression, a measure is aggregrated to the level of detail of the visualization. (I.e the current filter context determined by the dimensions in the row, column and filter shelves. In other words with LOD expressions, you can override the filter context and choose the level of detail for your measures.
Create a new calculated field in Tableau called "Sales By Customer" and type
{FIXED [Customer Name] : SUM([Sales])}
This ensures that regardless of the fields in the visual, sales is always aggregated at the customer level.
Try It: Using Tableau's sample superstore data, add the following to the rows shelf:
You should see sales being aggregrated on the Customer Name Level for "Sales By Customer" and being aggregrated at the Order ID level for "Sales". If you remove Order ID, the two sales columns will match since the aggregration of "Sales" is being controlled by the visualization (i.e the dimensions placed on the row shelf).
There are three LOD Tableau Keywords:
The general syntax for writing LOD expressions is
{FIXED [Name of Dimension] : SUM([Name of Measure])}
{INCLUDE [Name of Dimension 1], [Name of Dimension 2],...,[Name of Dimension N] : SUM([Name of Measure])}
{EXCLUDE [Name of Dimension 1], [Name of Dimension 2],...,[Name of Dimension N] : SUM([Name of Measure])}
The level of aggregration can be SUM, AVG, MEDIAN, COUNT, ATTR, etc
When using INCLUDE or EXCLUDE you can specify multiple dimensions. To Ignore all dimensions in the filter, surround the meaure with curly braces. For example:
{SUM([Sales])}
This will return all sales regardless of the dimensions in the visual.