LOD expressions in Tableau are calculated fields that control the exact dimension at which an aggregation runs, independent of the current view. Tableau supports three types: FIXED (ignores view-level dimension filters), INCLUDE (adds a dimension to the calculation) and EXCLUDE (removes one). They are the primary tool for cohort analysis, customer-level metrics and benchmark comparisons.
LOD expressions in Tableau let you control the level of detail at which a calculation runs, completely independent of the view’s current aggregation. Instead of being locked to whatever dimensions you’ve dropped on the canvas, you tell Tableau exactly which fields to group by. That single capability is what separates intermediate Tableau users from advanced ones, and it’s the concept that trips up most people preparing for data analyst interview questions.
- Calculated fields are the foundation: every formula, function and LOD expression lives inside one.
- CASE and date functions handle conditional logic and time-based analysis, the two most common real-world needs.
- Table calculations run after the data is pulled from the source, so they only see what’s already in the view.
- LOD expressions (FIXED, INCLUDE, EXCLUDE) run at the data source level, giving you aggregation control no table calc can match.
- Knowing which calculation type to reach for first saves hours of debugging and makes your dashboards far easier for others to maintain.
Types of Calculations in Tableau
Every number you compute in Tableau lives inside a calculated field. You create one by right-clicking the data pane, choosing “Create Calculated Field,” typing a formula, and clicking OK. The result behaves like any other field: drag it onto a shelf and Tableau aggregates it.
There are three broad families of calculations, and picking the wrong one is the most common mistake beginners make on the job.
Basic Calculated Fields
These are row-level or aggregate formulas that run against every row in the data source. A simple example: [Sales] * 0.18 adds a GST column to every transaction row in an Indian retail dataset. Aggregate versions like SUM([Profit]) / SUM([Sales]) give you a profit margin that responds to whatever filters and dimensions are in the view.
Row-level fields are fast and predictable. They’re the right starting point whenever your calculation doesn’t need to “look across” different dimension members.
When to Use Each Calculation Type
| Calculation Type | Where It Runs | Typical Use Case | Filter Order of Operations Rank (1 = earliest) | Sees View Filters? |
|---|---|---|---|---|
| Basic Calculated Field | Data source (row level or aggregate) | GST amount, profit margin | 2 | Yes |
| Table Calculation | After query, on the view | Running total, rank within category | 6 (last) | Only rows visible in view |
| LOD Expression — FIXED | Data source, ignores view dimension filters | Customer first order date, cohort size | 3 (after context filters) | Context filters only |
| LOD Expression — INCLUDE | Data source, adds a dimension | Average orders per customer per city | 4 | Yes |
| LOD Expression — EXCLUDE | Data source, removes a dimension | Category total regardless of sub-category | 4 | Yes |
Tableau is consistently ranked among the top data science tools companies use, and the reason is largely this flexibility. You can answer almost any business question without leaving the tool, as long as you know which calculation layer to use.
Functions: CASE and Date Functions
Tableau ships with hundreds of built-in functions. Two categories come up constantly in real dashboards: conditional logic functions (especially CASE) and date functions. Getting comfortable with both puts you ahead of most self-taught analysts.
How to Use CASE in Tableau
The CASE statement evaluates an expression against a list of values and returns a result for the first match, exactly like a SWITCH statement in programming. The syntax is clean:
CASE [Region] WHEN “North” THEN “Northern Zone” WHEN “South” THEN “Southern Zone” ELSE “Other” END
You’d use this to remap raw dimension values, say, consolidating 28 Indian state names into five sales zones for an executive dashboard. The alternative is IF/ELSEIF, which is better when your condition is a comparison rather than an exact match: IF [Sales] > 100000 THEN “High” ELSEIF [Sales] > 50000 THEN “Medium” ELSE “Low” END.
A common mistake: wrapping a CASE around an aggregated field. CASE works at the row level. If you need conditional logic on an aggregated result, use IF with SUM or AVG inside it.
Date Functions in Tableau
Tableau’s date functions are among the most practical in any BI tool. The ones you’ll use almost every day:
- DATEPART(‘month’, [Order Date]): extracts the month number (1-12) from a date field, useful for month-over-month comparisons.
- DATEDIFF(‘day’, [Order Date], [Ship Date]): calculates the number of days between two dates, ideal for delivery performance tracking.
- DATETRUNC(‘quarter’, [Order Date]): snaps a date back to the start of its quarter, letting you group irregular dates cleanly.
- TODAY() and NOW(): return the current date or datetime, handy for “days since last order” calculations.
- DATENAME(‘weekday’, [Order Date]): returns the name of the day (Monday, Tuesday…), useful for spotting weekly sales patterns.
If you’re building dashboards for a supply chain team in Mumbai or Bengaluru, DATEDIFF combined with a CASE statement on weekday names can highlight whether delivery delays cluster around weekends or public holidays. E-commerce companies like Flipkart and Zomato use exactly this kind of time-based aggregation to monitor last-mile delivery SLAs. That’s the kind of specific, actionable insight that gets dashboards actually used.
Table Calculations in Tableau
A table calculation in Tableau is a computation that runs on the results already returned to the view, not on the underlying data source. Think of it as a second pass over the numbers Tableau has already aggregated. That distinction matters a lot in practice.
Common Table Calculations
WINDOW_SUM(SUM([Sales])) adds up sales across all rows visible in the view, regardless of partitioning. RANK(SUM([Profit])) ranks each dimension member by profit. RUNNING_SUM(SUM([Sales])) gives a cumulative total that resets at the start of each partition.
You add a table calculation by clicking a measure on a shelf and choosing “Add Table Calculation,” or by typing the function directly in a calculated field. The “Compute Using” setting is where most people get confused: it controls whether the calculation runs across rows, down columns, across a specific dimension, or across the entire table.
The Practical Limitation You Need to Know
Table calculations only see what’s in the view. If you filter out a dimension member, it disappears from the calculation too. That’s fine for running totals or rankings within a filtered view, but it’s the wrong tool if you need a grand total that ignores the current filter. That’s exactly the problem LOD expressions in Tableau solve.
According to LinkedIn’s 2024 Jobs on the Rise report, data analyst roles in India grew by over 40% year-on-year, with Tableau and Power BI listed as the most frequently cited tools in job postings. If you’re weighing your options, the Power BI vs Tableau comparison is worth reading before you commit to one path.
LOD Expressions in Tableau Explained: FIXED, INCLUDE and EXCLUDE
LOD expressions in Tableau (Level of Detail expressions) let you specify the exact dimension or set of dimensions at which an aggregation should happen, completely separate from what’s on the view. The syntax always follows the same pattern: {TYPE [Dimension] : AGGREGATE([Measure])}.
FIXED LOD Expression: The Most Powerful Type
FIXED calculates at the dimension you specify and ignores all dimension filters in the view (only context filters, data source filters and extract filters can override it). A classic use case: finding each customer’s first purchase date in an e-commerce dataset.
{FIXED [Customer ID] : MIN([Order Date])}
This gives you one date per customer, no matter how many orders they’ve placed, and it doesn’t change when you filter the view by product category or region. You’d then use this as a base to build cohort analysis, one of the most requested skills in data analytics projects.
INCLUDE LOD Expression: Adding a Dimension the View Doesn’t Have
INCLUDE adds a dimension to the calculation that isn’t in the view, then aggregates back up. Say your view shows average sales per city, but you want the average of per-customer sales within each city. The view doesn’t have Customer ID on the canvas.
{INCLUDE [Customer ID] : SUM([Sales])}
Wrap that in AVG() on the view and you get the average customer-level sales per city, which is a very different number from simply averaging all transactions per city.
EXCLUDE LOD Expression: Removing a Dimension That’s Already There
EXCLUDE drops a dimension from the calculation even though it’s present in the view. If your view is broken down by Sub-Category and you want to compare each sub-category’s sales against its parent Category total, you’d use:
{EXCLUDE [Sub-Category] : SUM([Sales])}
That gives you the category-level total sitting alongside each sub-category row, making percentage-of-total calculations straightforward.
FIXED vs INCLUDE in Tableau: When to Use Which
Use FIXED when the dimension you’re grouping by is permanent and shouldn’t shift with view filters. Cohort sizes, customer segments, and baseline benchmarks are good examples. Use INCLUDE when you need a finer-grained aggregation than the view shows, and you want that calculation to respect the user’s current filters. The difference shows up clearly in dashboards where end users apply dimension filters: FIXED ignores them, INCLUDE respects them.
This distinction is also one of the most common questions in technical interviews for analyst roles. The data analyst vs data scientist comparison covers which skills each role prioritises, and Tableau LOD fluency sits firmly in the analyst column.
NASSCOM’s India Tech Talent Report 2024 noted that demand for analytics professionals with hands-on BI tool experience grew by 35% compared to 2022, with Tableau cited in 6 out of 10 analytics job descriptions surveyed. That number reflects why Tableau-specific skills consistently appear on lists of the highest paying tech skills for Indian professionals. Separately, AmbitionBox salary data for 2024 shows that Tableau-proficient data analysts in India earn a median annual salary of approximately Rs 7.2 lakh, rising to Rs 12 lakh or more at the senior level, a gap that correlates directly with advanced skills like LOD expressions.
The official Tableau LOD Expression documentation is the most reliable reference for syntax edge cases, particularly around filter order of operations, which catches even experienced users off guard.
Frequently Asked Questions
What are LOD expressions in Tableau?
LOD expressions in Tableau (Level of Detail expressions) are a type of calculated field that lets you define the exact dimension at which an aggregation runs, independent of the current view. Tableau supports three types: FIXED (ignores view filters), INCLUDE (adds a dimension to the calculation) and EXCLUDE (removes a dimension from it). They’re the go-to tool when a basic calculated field or table calculation can’t give you the right aggregation level.
What is a table calculation in Tableau?
A table calculation is a computation that runs on the data already returned to the view, after Tableau has queried the data source. Common examples include RUNNING_SUM, RANK and WINDOW_SUM. Because they operate on what’s visible in the view, they’re affected by dimension filters and only see the rows and columns currently displayed on the canvas.
How do I use CASE in Tableau?
Write a CASE expression in a calculated field using the syntax: CASE [Field] WHEN “Value1” THEN “Result1” WHEN “Value2” THEN “Result2” ELSE “Default” END. It evaluates the field against each WHEN clause and returns the first match. Use CASE for exact-match remapping (like converting state codes to region names) and use IF/ELSEIF when your condition involves a comparison operator like greater than or less than.
What date functions does Tableau have?
Tableau includes DATEPART (extracts a part like month or year), DATEDIFF (calculates the interval between two dates), DATETRUNC (rounds a date to the nearest period boundary), DATENAME (returns the name of a date part), TODAY and NOW. These functions cover nearly every time-based analysis need, from delivery time calculations to year-over-year growth comparisons, without any custom SQL.
When should I use FIXED vs INCLUDE in Tableau?
Use FIXED when you need an aggregation that stays constant regardless of what filters the user applies to the view, such as a customer’s first order date or a cohort’s baseline size. Use INCLUDE when you want a finer-grained calculation that still respects the user’s current dimension filters, such as average sales per customer within a filtered city or product category.
Can LOD expressions in Tableau be used with filters?
Yes, but the filter interaction depends on the LOD type. FIXED expressions only respond to context filters, data source filters and extract filters — standard dimension filters in the view do not affect them. INCLUDE and EXCLUDE expressions respect all view-level filters. Understanding this filter order of operations is essential for building dashboards where users expect their filter selections to update every number on screen.
The clearest path forward is practice on real data: build a calculated field today, then replace it with an LOD expression and compare the results under different filters. That one exercise teaches you more than any tutorial.
- Download the Superstore sample dataset (bundled with Tableau Desktop or Tableau Public) and recreate each expression in this article: a CASE-based region mapping, a DATEDIFF delivery metric, a RUNNING_SUM table calculation, and a FIXED cohort date.
- Explore the data analytics projects guide on 3.0 University to find a project where you can apply LOD expressions in Tableau to a real-world dataset and add it to your portfolio.
- Security analysts use the same aggregation and filtering logic every day to group log events and isolate anomalies — skills that transfer directly from Tableau LOD thinking. The EC-Council Certified SOC Analyst course at 3.0 University builds on exactly this kind of structured data reasoning. Browse the full 3.0 University course catalogue to see where your data skills can take you next.
Last updated: October 2026. Reviewed by the 3University editorial team.