top of page

Welcome
to NumpyNinja Blogs

NumpyNinja: Blogs. Demystifying Tech,

One Blog at a Time.
Millions of views. 

Unlocking Tableau Superpowers: A Beginner’s Guide to LOD Expressions

May 23, 2025
4 min read

When you start using Tableau, it’s easy to fall in love with how quickly you can create charts, dashboards and insights. But as you dig deeper, there comes a point where your visualizations hit a wall—especially when the numbers aren’t adding up quite the way you expect.

Let’s say you want to calculate the average sales per customer, but you’re showing data at the region level. Or you want to fix a benchmark KPI that doesn't change no matter how users filter the dashboard.

This is where Level of Detail (LOD) Expressions become your secret weapon. And yet, many Tableau users shy away from LODs because they seem complicated.

In this blog, I will simplify what LODs are, break down the three types and explore real-world examples that show why every Tableau user should master them. By the end, you'll know when and how to use FIXED, INCLUDE, and EXCLUDE—and how they can dramatically boost your analytical capabilities.


What Are LOD Expressions in Tableau?

In simple terms, LOD Expressions allow you to control the granularity at which Tableau performs a calculation—regardless of what’s currently visible in your dashboard. Without LODs, Tableau automatically performs calculations at the “level of detail” present in your view. That means if your chart shows data by month, then any calculated field is also computed monthly.

But what if you want to calculate something customer-level, while showing region-level results?

That’s where LODs give you flexibility and control.

The Basic Syntax:

{ TYPE [Dimension(s)] : Aggregation }

Where TYPE can be: FIXED, NCLUDE, EXCLUDE.

Let’s now explore these in detail with practical scenarios.


  1. FIXED LOD: Lock It in, No Matter What

Use Case: You want to calculate total sales per customer, regardless of filters or visual level.

{ FIXED [Customer Name] : SUM([Sales]) }

This formula calculates the total sales per customer independently of what’s in your view. Whether you’re showing monthly data, regional summaries, or category breakdowns—this calculation stays fixed at the customer level.

Perfect for:

  • Customer segmentation (e.g., high-value vs low-value)

  • Company-wide benchmarks

  • Creating a reference point that never changes

Real Scenario:

FIXED LODs work well with filters (unlike INCLUDE and EXCLUDE, which depend on dimensions in the view).

For example, You’re building a dashboard that allows users to filter by region. But your stakeholders still want to see a KPI for “Total Sales per Customer” that doesn’t change with filters. Use FIXED to make it happen.


  1. INCLUDE LOD: Add Detail to Your View

Use Case: You're analyzing sales by region, but want to include the detail of each customer to calculate average sales per customer per region.

{ INCLUDE [Customer Name] : AVG([Sales]) }

This formula temporarily adds [Customer Name] into the calculation—even if the visual doesn’t display it. Tableau then calculates average sales per customer and rolls that up to the region level.

Perfect for:

  • Per-user, per-transaction metrics

  • If you want more detail than the view shows

  • Multi-level aggregation in one view

  • Detailed breakdowns while keeping dashboards clean

Since INCLUDE depends on your view’s dimensions, adding or removing dimensions can affect the result.

Real Scenario:

You're preparing a regional sales report, but management wants to know the average sale per customer within each region, without cluttering the dashboard with customer names. This is INCLUDE’s sweet spot.


  1. EXCLUDE LOD: Remove Unwanted Detail

Use Case: You’re viewing sales by sub-category, but want to show category-level totals for comparison.

{ EXCLUDE [Sub-Category] : SUM([Sales]) }

This tells Tableau: “Forget sub-category, just sum by category—even if sub-category is in the view.”

Perfect for:

  • Removing granular noise from a calculation

  • Calculating percent of total at a higher level

  • Smoothing over-detailed visuals

Real Scenario:

You're creating a stacked bar chart that breaks down sales by sub-category within each category. But you want to overlay a target line that represents total category sales. EXCLUDE gives you the control to calculate it precisely.


Combine LODs with Table Calculations

Want to get even fancier? You can layer LODs with table calculations to create dynamic, flexible analytics like:

  • Rank customers by fixed total sales

  • Calculate the percent difference from a benchmark

  • Create KPIs that remain consistent no matter how filters change

Example: RANK_UNIQUE({ FIXED [Customer ID] : SUM([Sales]) })

Use this to create leaderboards, identify top performers, or highlight anomalies.


When Should You Use LOD Expressions?

Use LOD expressions when:

  • Your aggregation level doesn't match the level of detail in your view

  • You need consistent reference values (e.g., company-wide averages)

  • You’re building KPIs or benchmarks

  • Table calculations get too messy or aren’t flexible enough

LOD Expressions = Granular control + Clean dashboards.


Real Use Case: Customer Segmentation

Let’s say your company wants to create a segment of “VIP customers” who have spent more than $5,000 overall. But your dashboard contains filters and views that change constantly.

Here’s how to ensure your logic remains unaffected:

IF { FIXED [Customer ID] : SUM([Sales]) } > 5000 THEN 'VIP' ELSE 'Regular' END

Now, this segmentation works anywhere—across dashboards, across filters—because it’s calculated at a fixed level.


Final Thought

LOD Expressions aren’t just an “advanced feature.” They’re a superpower. Once you grasp them, you’ll unlock a new level of sophistication in Tableau: Cleaner dashboards, Consistent KPIs, More powerful interactivity, Reliable benchmarks. So next time your dashboard gives inconsistent numbers, or your calculated field seems off—don’t panic. Reach for an LOD expression, and take control of your data story.



 
 

+1 (302) 200-8320

NumPy_Ninja_Logo (1).png

Numpy Ninja Inc. 8 The Grn Ste A Dover, DE 19901

© Copyright 2025 by Numpy Ninja Inc.

  • Twitter
  • LinkedIn
bottom of page