Order of Operations in Tableau

While using Tableau to create charts and tables, I got into situations where the filters just didn’t show records as expected. For example, I wanted to find the first order date for each customer using a Fixed LOD calculation. It worked fine at first, but when I applied a Category filter, nothing changed in the results.

I expected the first order date to update based on my filter, but instead, Tableau kept showing the overall first order date for each customer.

While searching for solutions, I came to know that Tableau doesn’t apply filters and calculations all at once. It processes them in a specific sequence called Order of Operations, and we need to understand this sequence to fix the problems.

In this tutorial, I will explain what the Order of Operations is in Tableau and with the help of examples, I will show the correct order of execution in Tableau.

Tableau Order of Operations

The Tableau Order of Operations is the query pipeline that determines the sequence in which data is filtered and calculations are performed. It starts with data source filters and progresses through dimension, context, measure, and table calculation filters to the final calculation.

Below is the sequence in which the order of operations is executed in Tableau.

Implement Implement Order of Operation in Tableau

In the below example, I will exaplain how to use the correct orders of operations in Tableau with four common problems related to Order of Operations.

Example-1 : Dimension and Context Filters With Fixed LODs

For example, you created a fixed calculation to get the first order date for each customer. When you apply a Category filter, the calculation doesn’t change. It still shows the first order date across all categories.

In Tableau, FIXED LODs are computed before dimension filters in Order of Operations. That means the calculation is locked to the entire dataset, ignoring filter.

As solution for this, follow the below steps to implement the correct order of oeprations to get accurate results.

  1. Create a calculated field that give first order date for each customer.
{FIXED [Customer Name]: MIN([Order Date])}  
  1. Add the calculated field to the Text card in Marks section and Customer Name to the Rows.
Order of Operation for Context Filter in Tableau
  1. After this, add Category to the Filters -> select categories -> add filtered categories to the Rows before Customer Name.