Tableau Cheat Sheet¶
Quick reference for Tableau Desktop — connecting data, building views, calculated fields, and performance.
Core Concepts¶
| Term | Meaning |
|---|---|
| Dimension | Categorical field (text, date, boolean) — used for grouping/filtering |
| Measure | Numeric field (quantitative) — used for aggregation |
| Continuous | Blue pill — draws an axis, shows a range |
| Discrete | Green pill — creates headers, shows distinct values |
| Mark | A single data point (bar, point, line segment) |
| Level of Detail (LOD) | The granularity of the view |
Connecting Data¶
- Connect → choose source (Excel, Text File, Server → PostgreSQL/MySQL/SQL Server)
- Data Source tab: drag tables, configure joins
- Live vs Extract: Live = real-time queries; Extract = fast, offline copy
- Joins: drag table next to existing → choose join type (inner/left/right/full)
- Unions: drag table below existing → combine rows from similar tables
- Relationships (Tableau 2020.2+): flexible connections without predetermined joins
Building a View¶
- Double-click a field to add to view
- Drag to Rows / Columns shelf
- Drag a measure to the view — Tableau auto-aggregates (SUM default)
- Change aggregation: right-click pill → Measure → choose SUM/AVG/COUNT/etc.
- Change chart type: Show Me panel (top right) → click chart icon
Common drag patterns:
| Result | Action |
|---|---|
| Bar chart | Date → Columns, Revenue → Rows |
| Line chart | Date (continuous) → Columns, Revenue → Rows |
| Scatter plot | One measure → Columns, another → Rows |
| Map | Geographic field → double click (auto-places on map) |
| Heatmap | Dimension → Columns, Dimension → Rows, Measure → Color |
Filters¶
| Type | Where | When to use |
|---|---|---|
| Data Source filter | Data Source tab | Filter before loading (performance) |
| Extract filter | When creating extract | Reduce extract size |
| Dimension filter | Filters shelf | Limit which categories appear |
| Measure filter | Filters shelf | Filter by value range or condition |
| Context filter | Right-click → Add to Context | Makes other filters dependent |
| Quick filter | Show Filter on a field | Give users interactive control |
Filter order: Data Source → Extract → Context → Dimension → Measure → Table Calc
Calculated Fields¶
To create: Analysis → Create Calculated Field (or right-click in Data pane)
Basic calculations¶
// Order size classification
IF [Total] > 300 THEN "Large"
ELSEIF [Total] > 100 THEN "Medium"
ELSE "Small"
END
// Profit margin
([Revenue] - [Cost]) / [Revenue]
// Days since last order
DATEDIFF('day', [Order Date], TODAY())
String functions¶
UPPER([Customer Name])
LOWER([Email])
TRIM([Product Name])
LEFT([Order ID], 4)
CONTAINS([Email], "@gmail")
SPLIT([Full Name], " ", 1) // first name
Date functions¶
YEAR([Order Date])
MONTH([Order Date])
DATETRUNC('month', [Order Date]) // first day of month
DATEADD('month', 1, [Order Date]) // add 1 month
DATEDIFF('day', [Order Date], [Delivery Date])
Table calculations (run on the view, not the data)¶
// Running total
RUNNING_SUM(SUM([Revenue]))
// % of total
SUM([Revenue]) / TOTAL(SUM([Revenue]))
// Rank
RANK(SUM([Revenue]))
// Previous value (like SQL LAG)
LOOKUP(SUM([Revenue]), -1)
// Window average
WINDOW_AVG(SUM([Revenue]))
Level of Detail (LOD) Expressions¶
LOD expressions compute at a different level from the view.
// FIXED: always compute at specified level (ignores view filters)
{ FIXED [Customer ID] : SUM([Revenue]) } // each customer's total, on every row
// INCLUDE: add a dimension to the detail level
{ INCLUDE [Product] : AVG([Unit Price]) }
// EXCLUDE: remove a dimension from the detail level
{ EXCLUDE [Quarter] : SUM([Revenue]) } // ignores the quarter filter
Common use: show each customer's revenue vs the overall total on the same view.
Dashboard Design¶
- New Dashboard sheet (bottom tab) → set size
- Drag sheets onto canvas
- Use Horizontal/Vertical containers for layout control
- Add filters: right-click a filter on a sheet → Apply to Worksheets → All using this Data Source
- Actions: Dashboard → Actions → add Filter/Highlight/URL action for interactivity
- Device layouts: Dashboard → Device Preview → customise for phone/tablet
Layout tips: - Floating vs Tiled: Tiled scales automatically; Floating gives pixel control - Use blank objects as spacers - Test with "Fit → Entire View" to ensure nothing is cut off
Performance Tips¶
| Problem | Solution |
|---|---|
| Slow dashboard | Use an extract instead of live connection |
| Slow calculated field | Push calculation to the database (custom SQL) |
| Too many marks (>100k) | Aggregate — use Level of Detail or reduce date granularity |
| Slow filters | Add a Context Filter for high-cardinality dimensions |
| Large extract | Use incremental refresh, add date filter to extract |
Keyboard Shortcuts (Desktop)¶
| Shortcut | Action |
|---|---|
Ctrl + Z |
Undo |
Ctrl + W |
Clear sheet |
Ctrl + Alt + C |
Duplicate sheet |
Ctrl + D |
Connect to data source |
Ctrl + E |
Edit calculated field |
Ctrl + Shift + B |
Show/hide bookmarks |
Alt + drag |
Multi-select marks on canvas |
| Right-click measure → Show Me | Quick chart suggestion |
Ctrl + 1 |
Rows shelf |
Ctrl + 2 |
Columns shelf |