Note: ensure to Show/Hide Captions in the workbook.
SUM([Sales]) / ATTR({FIXED : SUM([Sales])})
ATTR( {EXCLUDE [Category]: SUM([Sales])} ) / ATTR( {FIXED : SUM([Sales])} )
{FIXED [State]: SUM([Sales])}
SUM( {FIXED [State]: SUM([Sales])} ) / ATTR( {FIXED : SUM([Sales])} )INCLUDE and EXCLUDE level of detail expressions are affected by dimension filters, since they are evaluated after dimension filters.
Filtering a FIXED Level of Detail Expression without adding the filter to context works as follows:
Just as each mark in the view aggregates along its dimension values, a Level of Detail Expression has an effect for each combination of dimension values in its Dimension Declaration.
The below calculation will return 50 results if there are 50 states in the data with values for [Sales].
{FIXED [State]: SUM([Sales])}
Although what is inside the FIXED statement's curly braces {} is not affected by a dimension filter, when we add the calculation to the view we give it an aggregation. Because we are aggregating across [State], the [State] filter affects the results.
In general, when a dimension from a FIXED Level of Detail Expression's dimension declaration is filtered, the aggregated results of the FIXED calculation will be affected.
SUM( {FIXED [State]: SUM([Sales])} ) is affected by a [State] filter, and therefore we can use it as our numerator:
SUM( {FIXED [State]: SUM([Sales])} ) / ATTR( {FIXED : SUM([Sales])} )
Tableau's Order of Operations
Understanding Level of Detail (LOD) Expressions
001456685

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.