KNOWLEDGE BASE

## Understanding How LOD and Table Calculations are Computed

Published: 11 Oct 2016

### Question

How does  "Compute using" in a table calculation differ from "fixed" in a level of detail (LOD) calculation?

For example: Why does a Table Calculation set to Compute Using: <Dimension1> not equal LoD fixed to <Dimension1>? But a Table Calculation set to Compute Using <Dimension1> is equal to an LoD fixed to <Dimension2>?

### Environment

Tableau Desktop

On the other hand, when we say that LoD expressions "compute values using the specified dimensions without reference to the view level of detail", we are using the verb compute in a general sense. For more information, see Overview: Level of Detail Expressions.

While table calculations and LoD expressions can be edited to produce similar results, they are not structured in the same way and will respond differently to changes in the view.

For example, in a view built with Superstore data using just Category and Segment (see attached workbook sample):

Percent of Total - LoD
SUM([Sales]) / SUM({FIXED [Category]: SUM([Sales])})
• Compute the denominator by Category regardless of the structure of the view
• Compute the numerator by the structure of the view
• Sum of the records for every Segment, divided by the total sum of records for each Category

Percent of Total - TC Category
SUM([Sales]) / TOTAL(SUM([Sales]))
*set to Compute Using: Category
• Address Category, partition by Segment
• Sum of the records for every Category, divided by the total sum of records for each Segment

Percent of Total - TC Segment
SUM([Sales]) / TOTAL(SUM([Sales]))
*set to Compute Using: Segment
• Address Segment, partition by Category
• Sum of the records for every Segment, divided by the total sum of records for each Category

With just Segment and Category in the view, Percent of Total - LoD Category and Percent of Total -  TC Segment break down into the same computation, and therefore have the same results.

However, if we complicate the view with an additional Dimension, all three of the above calculations will now have different results due to the impact of the new Dimension on the view.