Tableau for Data Analytics · Lesson 2 of 3
Tableau Calculated Fields, Filters, and Dashboard Actions
Create reusable calculations and interactions while keeping filter behavior understandable.
Lesson
1. Introduction
Calculated fields and filters turn a static view into an analytical tool. Each interaction should have a predictable effect so users can explore without losing track of the population being shown.
2. Understand the concept
A calculated field derives a value from data. Parameters let users provide a value, while filters restrict records or marks. Dashboard actions can filter or highlight another view; document how actions interact and provide a clear way to reset them.
3. Syntax and interpretation
IF SUM([Sales]) = 0 THEN NULL
ELSE SUM([Profit]) / SUM([Sales])
ENDThis is a ratio of aggregated values. It may differ from averaging row-level profit ratios, so use the definition required by the business.
4. Apply it to an analysis
Create reusable calculations and interactions while keeping filter behavior understandable. Start with a small, known example and state what each row or value represents. After the transformation, check row counts, types, keys, and units against the original data. If an assumption fails, stop and investigate instead of presenting the output as a valid result.
5. Common mistakes
- Mixing row-level and aggregate expressions without understanding Tableau’s aggregation rules.
- Leaving a dashboard filtered with no visible indication of the active selection.
6. Practice task
A profit-margin field can be calculated as total profit divided by total sales. Why might averaging row-level margins give a different result?
7. One possible solution
Each row may have a different sales weight. The ratio of totals weights rows by sales; an unweighted average treats every row equally.8. Summary and next step
Create reusable calculations and interactions while keeping filter behavior understandable. Continue to the next course section and apply this foundation to a different analytics tool or workflow.
Visual guide
Working through Tableau Calculated Fields, Filters, and Dashboard Actions
-
Step 01
Define
State the question, data grain, and expected output.
-
Step 02
Apply
Use the method and check its assumptions on a small example.
-
Step 03
Verify
Reconcile the result and communicate limitations.
Code examples
IF SUM([Sales]) >= 10000 THEN \"Above target\"\nELSE \"Below target\"\nEND
Labels each view according to its aggregated sales value.
Source sheet: Region summary\nTarget sheet: Order details\nRun action: Select\nClearing selection: Show all values
Selecting a region filters the detail view; clearing restores the full view.
Key points
- Create reusable calculations and interactions while keeping filter behavior understandable.
- Check the result against the stated data definition and a representative example.
- Record assumptions and report data-quality limitations rather than hiding them.
Check your understanding
Practice
Your learning progress