Tableau Basics Cheat Sheet
Introduces Tableau's dimensions, measures, calculated fields, and Level of Detail expressions for building interactive dashboards and worksheets.
Core Concepts
The vocabulary behind every Tableau worksheet.
- Dimensions- Categorical/qualitative fields (e.g. Region, Category) that slice data into groups; typically blue pills
- Measures- Quantitative, aggregable fields (e.g. Sales, Profit); typically green pills, default aggregation SUM
- Marks card- Controls color, size, label, detail, and tooltip for the marks in a view
- Shelves (Rows/Columns)- Dragging fields here defines the axes and structure of the visualization
- Worksheet vs. Dashboard vs. Story- Worksheet is a single chart, Dashboard combines views, Story sequences dashboards for narrative
- Live vs. Extract connection- Live queries the source in real time; Extract creates a local snapshot (.hyper) for performance
Calculated Fields & LOD
Common calculation and Level of Detail expression syntax.
// Basic calculated field: Profit RatioSUM([Profit]) / SUM([Sales])// IF/ELSEIF logicIF [Sales] > 1000 THEN "High"ELSEIF [Sales] > 500 THEN "Medium"ELSE "Low"END// Date calculationDATEDIFF('day', [Order Date], [Ship Date])// LOD: total sales per customer, independent of view filters{ FIXED [Customer ID] : SUM([Sales]) }// LOD: each customer's sales as a share of the overall totalSUM([Sales]) / { FIXED : SUM([Sales]) }
Building Common Charts
How to construct the most common view types.
- Bar chart- Drag a dimension to Rows/Columns and a measure to the other shelf
- Line chart- Drag a date field to Columns and a measure to Rows; Tableau auto-detects continuous date
- Heat map- Two dimensions on Rows/Columns, a measure mapped to Color on the Marks card
- Filters shelf- Drag a field here to restrict the view; context filters improve performance for dependent filters
- Dual axis- Combine two measures on the same chart by dragging a second measure onto the existing axis
Table Calculations
Compute values relative to other cells in the view, with explicit control over addressing and partitioning.
// Running sum along the table (down)RUNNING_SUM(SUM([Sales]))// Percent of total within a partitionSUM([Sales]) / TOTAL(SUM([Sales]))// Rank measure, ties broken by unique valueRANK_UNIQUE(SUM([Sales]))// Moving average over the trailing 3 periodsWINDOW_AVG(SUM([Sales]), -2, 0)// Index of the current row within its partitionINDEX()// Year-over-year % change using LOOKUP(SUM([Sales]) - LOOKUP(SUM([Sales]), -1)) / ABS(LOOKUP(SUM([Sales]), -1))
Advanced LOD Expressions
INCLUDE/EXCLUDE extend FIXED for view-dependent aggregation at a different granularity than the visualization.
- { FIXED [dim] : agg }- Computes at exactly the specified dimension(s), ignoring all view filters except context/data-source filters
- { INCLUDE [dim] : agg }- Adds a finer dimension to the view's existing granularity before aggregating (e.g. avg per order, then averaged up to region)
- { EXCLUDE [dim] : agg }- Removes a dimension from the view's granularity, useful for 'percent of grand total ignoring one filter'
- Nested LOD- FIXED expressions can reference other FIXED expressions to build multi-level aggregations (e.g. avg of per-customer totals)
- Order of operations- Data source filters -> context filters -> FIXED LOD -> dimension/measure filters -> INCLUDE/EXCLUDE LOD -> table calcs
Sets and Parameters for Dynamic Views
Sets define reusable member subsets; parameters let end users swap fields or thresholds interactively.
// Parameter-driven measure swap (Parameter: "Metric" with values "Sales"/"Profit")CASE [Metric] WHEN "Sales" THEN SUM([Sales]) WHEN "Profit" THEN SUM([Profit])END// Dynamic Top-N using a parameter{ FIXED [Customer Name] : SUM([Sales]) } >=WINDOW_MAX(RANK({ FIXED [Customer Name] : SUM([Sales]) }) <= [Top N Parameter])// Set-based IN/OUT flag for combo chartsIF [Customer Name] Set THEN "In Set" ELSE "Other" END// Combining a set with a calculated field to build a highlighterIIF([High Value Customers], SUM([Sales]), NULL)
Dashboard Interactivity
Actions and layout controls used to build guided-analytics dashboards.
- Filter action- Clicking/hovering a mark in one sheet filters other sheets on the dashboard
- Highlight action- Visually emphasizes related marks across sheets without filtering out the rest
- URL action- Opens an external link, optionally passing field values via parameters in the URL
- Parameter action- A mark selection or hover updates a parameter's value, enabling click-to-swap-metric dashboards
- Set action- Clicking marks adds/removes them from a set, driving highlighter and comparison dashboards without calculated fields
- Floating vs. Tiled containers- Tiled auto-resizes with siblings; floating allows precise overlapping layout for KPI cards and legends
Use a FIXED LOD expression instead of a table calculation when you need a value like 'total sales per customer' to stay constant regardless of which filters or dimensions are added to the view.