Order of Operations in Tableau : Bijay Kumar
by: Bijay Kumar
blow post content copied from SalesForce FAQs
click here to view original post
### Summary of Tableau Order of Operations When working with Tableau to create charts and tables, users often encounter issues with filters not displaying results as anticipated. For instance, a user trying to find the first order date for each customer using a Fixed Level of Detail (LOD) calculation expected the results to update with applied filters, but they remained unchanged. This happens because Tableau processes filters and calculations in a specific sequence known as the **Order of Operations**. #### Key Details of the Order of Operations: 1. **Sequence of Execution**: - Tableau applies filters in a specific order starting from data source filters to context filters, and finally to table calculations. - The sequence is as follows: 1. Extract Filters 2. Data Source Filters 3. Context Filters 4. Sets, Conditional Filters, Top N Filters, Fixed LODs 5. Dimension Filters 6. Include/Exclude LODs 7. Data Blending 8. Measure Filters 9. Forecasts, Clusters, Totals 10. Table Calculations 11. Table Calculation Filters 12. Trend Lines & Reference Lines 2. **Common Problems**: - **Fixed LODs** do not consider dimension filters unless they are set as context filters. - **Top N filters** are computed before dimension filters, which can lead to unexpected results when additional filters are applied. - **Table Calculations**, like rank, reset based on the applied filters, affecting overall rankings. 3. **Solutions**: - Adding filters to context can allow calculations to reflect filtered data. - Utilizing Exclude LODs can help compare filtered and overall results accurately. - Adjustments in filter context can ensure Top N filters work correctly when other filters are applied. ### Conclusion Understanding the Order of Operations in Tableau is crucial for accurate data representation. By following the correct sequence and utilizing context filters wisely, users can achieve the desired results in their visualizations. ### Additional Information For a deeper understanding of specific cases, the tutorial explores several examples demonstrating how to effectively apply filters and LODs in Tableau. This knowledge can enhance data analysis and improve the accuracy of reports. ### Hashtags for SEO #Tableau #DataVisualization #OrderOfOperations #FiltersInTableau #TableauTips #DataAnalysis #BusinessIntelligence #TableauTutorial #LODCalculations #DataScience #AnalyticsTools
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.
- Extract Filters
- Data Source Filters
- Context Filters
- Sets, Conditional Filters, Top N Filters, Fixed LODs
- Dimension Filters
- Include/Exclude LODs
- Data Blending
- Measure Filters
- Forecasts, Clusters, Totals
- Table Calculations
- Table Calculation Filters
- Trend Lines & Reference Lines
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.
- Create a calculated field that give first order date for each customer.
{FIXED [Customer Name]: MIN([Order Date])}
- Add the calculated field to the Text card in Marks section and Customer Name to the Rows.

- After this, add Category to the Filters -> select categories -> add filtered categories to the Rows before Customer Name.

Here, we can see that after appying Category filter, the order date is unchanged. It is becausein Tableau order of operations Fixed LODs is calculated before dimension filters.
- To fix the unchanged changed calculation, right click on the Category filter and select Add to Context.

Now, we can see the Order Date for each customer is reflecting for the Category first. With the Context filter, Tableau recalculates the first order date considering the Category.

This way, we can use the dimensions and filters with Fixed LODs in Tableau with correct order of operation.
Example-2: Use Fixed, Exclude, and Include LODs
In this example, we will see how to use the Fixed, Exclude and Include LODs together in order of operations in Tableau. For example, we want to compare the maximum discount given per Sub-Category with filters applied and the overall maximum discount by ignoring filters.
Follow the steps below steps to see how we use the LODs in Tableau with correct order of operation.
- According to example, we will create two LODs using the formula below.
{ FIXED [Sub-Category] : MAX([Discount]) } // Max Discount Filtered
{ FIXED [Sub-Category] : MAX([Discount]) } // Max Discount Overall
- Now for the view add the calculated fields to the Text card. After this, add Segment and Category to the to the Rows.
With this, we will get same values for the overall discount and discount for the category.

Here, we want the Category filter to compute before Max Profit Filtered, but after Max Profit Overall. This is not possible because, as we noted above, a filter cannot be both a dimension filter and a context filter.
To fix this, we will replace the filtered discount calculation with the calculation below in which we will use the EXCLUDE function.
{EXCLUDE [Segment]: MAX([Discount])}
Now, with this formula, we can see the accurate calculation for the discount sum. Here, we can see the overall discount including segment and filtererd discount sum for category.

This way, we can use the Fixed, Exclude, and Include LODs with dimension filters in Tableau order of operation.
Example-3: Use Top N-Results With Dimesnion and Context Filters
In this example, we will see the issue that we face while use the Top-N filters with dimension and Context filters. For example, we are displaying Top 10 products by Profit using N filters. After applying the year filter same N filters returned less than 10 results.
We got these records because in Tableau, Top N filter is computed before dimension filters like Year.
Follow the steps below to see how we can use top N filters in tableau with dimension filters according to order of operation.
- Drag Product Name to Rows and Profit to Text card in the Marks section.
- To apply top N filters, right-click Product Name -> Filter -> Top tab -> choose By Field -> Top 10 by SUM(Profit) -> OK.

- After this, drag the Order Date to Filters -> choose Years -> click OK. Then drag this, filtered Order Date to the Rows.

With this, you will notice that the chart or table will not display the Top N results after applying the date filter. In this, Tableau is first calculating the top N filters and then it is applying year filter.
Right now the calcualtion is showing only those top N results that are from the selected year.
- To fix this, click on the Year filter in the Filters section and select Add to Context.

Now, we can see that the table is showing the results that are first filtered with selected year then it is filtered with top N results.

This way, we can use the Top N filters in Tableau along with the dimension filters to get the accurate results.
Example -4: Table Calculations and Calculation Filters
In this example, we will see the how we can keep accurate results for the calculation when we apply dimension filter on the calculations. For example, we are using rank calcualtion to display the states in order of their Sales rank.
On this calculation, when we will apply a dimension filter like Region then it will show the rank on states from 1 for selected region instead of overall rank.
In this the below steps we will see how we can show the overall rank of the states after applying the Region dimension filters.
- Create the calculated field “Sales Sales Rank” with the below formula to show the States in the order of Sales Rank.
RANK(SUM([Sales]))
- Drag the States to Columns and calculated field to the Text card in the Marks section.

- Now, add the Region to Rows and in the filters, select only East region.

Here, we can see the ranks are displayed specific to region instead of overall Sales rank.
- Now, to fix this, and show overall rank for the states, create a calculated field “Region Rank” using the formula below.
LOOKUP(MAX([Region]), 0)
- Add the calculated field Region Rank to the Filters. It will show the all the Regions, here select the East region.
Now, you will see the rank of states in Region according to overall sales.

This way, we can use dimensions with the calcultaion filters such as showing overall rank while filtering Region.
Conclusion
I hope by now you understand why Tableau gives unexpected results when we apply filters or calculations. The main reason is the Order of Operations, which decides the sequence in which Tableau processes everything.
In this tutorial, we have learned how FIXED LODs ignore dimension filters unless we add them to context, how INCLUDE and EXCLUDE can give more accurate calculation, how Top-N filters can behave differently with date filters, and how table calculations like rank can reset when filters are applied.
You may also like to read:
The post Order of Operations in Tableau appeared first on SalesForce FAQs.
September 26, 2025 at 10:55PM
Click here for more details...
=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Post a Comment