Bird
Raised Fist0
Tableaubi_tool~15 mins

Why calculations extend data analysis in Tableau - Business Case Study

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Scenario Mode
👤 Your Role: You are a business analyst at a retail company.
📋 Request: Your manager wants to understand how calculated fields can help reveal deeper insights from sales data beyond simple totals.
📊 Data: You have monthly sales data by product category and region, including sales amount and quantity sold.
🎯 Deliverable: Create a Tableau dashboard that uses calculated fields to show profit margin percentage and average sales per transaction, alongside total sales.
Progress0 / 6 steps
Sample Data
MonthRegionCategorySales AmountQuantity SoldCost AmountTransactions
JanNorthElectronics1200030900025
JanSouthFurniture800020600015
FebNorthElectronics15000351100030
FebSouthFurniture700018500012
MarNorthElectronics1300032950028
MarSouthFurniture900022650018
JanEastElectronics1100028850022
FebEastFurniture600015450010
MarEastElectronics14000331000027
1
Step 1: Connect the sales data to Tableau and create a new worksheet.
Import the sample data as a data source in Tableau.
Expected Result
Data is loaded and visible in Tableau's data pane.
2
Step 2: Create a calculated field named 'Profit Margin %' to show profit as a percentage of sales.
Profit Margin % = (SUM([Sales Amount]) - SUM([Cost Amount])) / SUM([Sales Amount]) * 100
Expected Result
A new field 'Profit Margin %' is available showing profit margin percentage for each data point.
3
Step 3: Create a calculated field named 'Average Sales per Transaction' to find average sales value per transaction.
Average Sales per Transaction = SUM([Sales Amount]) / SUM([Transactions])
Expected Result
A new field 'Average Sales per Transaction' is available showing average sales per transaction.
4
Step 4: Build a view with Rows = Month, Columns = Region, and Text showing SUM of Sales Amount.
Drag 'Month' to Rows, 'Region' to Columns, and SUM([Sales Amount]) to Text on Marks card.
Expected Result
Table shows total sales by month and region.
5
Step 5: Add 'Profit Margin %' and 'Average Sales per Transaction' as additional text fields in the view.
Drag 'Profit Margin %' and 'Average Sales per Transaction' to Tooltip or Text on Marks card.
Expected Result
Each cell shows sales amount, profit margin %, and average sales per transaction.
6
Step 6: Create a dashboard combining this worksheet with filters for Category and Region.
Add the worksheet to a new dashboard and add filter controls for 'Category' and 'Region'.
Expected Result
Dashboard allows interactive filtering and shows calculated insights alongside sales.
Final Result
-------------------------------------------------------------
| Month | North Sales | North Profit % | North Avg Sales Txn |
|-------|-------------|----------------|---------------------|
| Jan   | $12,000     | 25%            | $480                |
| Feb   | $15,000     | 26.7%          | $500                |
| Mar   | $13,000     | 26.9%          | $464                |
-------------------------------------------------------------
| Month | South Sales | South Profit % | South Avg Sales Txn |
|-------|-------------|----------------|---------------------|
| Jan   | $8,000      | 25%            | $533                |
| Feb   | $7,000      | 28.6%          | $583                |
| Mar   | $9,000      | 27.8%          | $500                |
-------------------------------------------------------------
| Month | East Sales  | East Profit %  | East Avg Sales Txn  |
|-------|-------------|----------------|---------------------|
| Jan   | $11,000     | 22.7%          | $500                |
| Feb   | $6,000      | 25%            | $600                |
| Mar   | $14,000     | 28.6%          | $519                |
-------------------------------------------------------------
Profit margin percentage reveals which regions and months are more profitable beyond just sales volume.
Average sales per transaction helps understand customer buying behavior and transaction value.
Calculations extend analysis by providing deeper insights that simple totals cannot show.
Bonus Challenge

Create a calculated field to show the percentage change in sales amount month-over-month for each region.

Show Hint
Use Tableau's LOOKUP() function to compare current month sales with previous month sales.

Practice

(1/5)
1. What is the main reason to use calculations in Tableau for data analysis?
easy
A. To create new data fields from existing data
B. To change the color of charts
C. To delete unwanted data rows
D. To export data to Excel

Solution

  1. Step 1: Understand the purpose of calculations

    Calculations in Tableau allow you to create new data fields by using existing data, which helps in deeper analysis.
  2. Step 2: Compare other options

    Changing colors, deleting rows, or exporting data are not the main purposes of calculations.
  3. Final Answer:

    To create new data fields from existing data -> Option A
  4. Quick Check:

    Calculations create new data fields [OK]
Hint: Calculations create new data, not just change visuals [OK]
Common Mistakes:
  • Thinking calculations only change chart colors
  • Confusing calculations with data export
  • Believing calculations delete data rows
2. Which of the following is the correct way to create a calculated field in Tableau?
easy
A. Click File > Export > Calculated Field
B. Right-click in Data pane > Create > Calculated Field
C. Double-click on a worksheet title
D. Drag a dimension to the Filters shelf

Solution

  1. Step 1: Recall how to create calculated fields

    In Tableau, you create calculated fields by right-clicking in the Data pane and selecting Create > Calculated Field.
  2. Step 2: Eliminate incorrect options

    Double-clicking worksheet title, exporting files, or dragging dimensions to Filters shelf do not create calculated fields.
  3. Final Answer:

    Right-click in Data pane > Create > Calculated Field -> Option B
  4. Quick Check:

    Right-click Data pane to create calculation [OK]
Hint: Right-click Data pane to add calculations fast [OK]
Common Mistakes:
  • Trying to create calculations from worksheet title
  • Confusing export with calculation creation
  • Using Filters shelf instead of Data pane
3. Given this Tableau calculation: IF [Sales] > 1000 THEN 'High' ELSE 'Low' END, what will be the result for a sale of 1500?
medium
A. 'Low'
B. 1500
C. 'High'
D. Error

Solution

  1. Step 1: Understand the IF statement logic

    The calculation checks if Sales is greater than 1000. If true, it returns 'High', else 'Low'.
  2. Step 2: Apply the condition to the value 1500

    Since 1500 > 1000, the condition is true, so the result is 'High'.
  3. Final Answer:

    'High' -> Option C
  4. Quick Check:

    1500 > 1000 means 'High' [OK]
Hint: Check condition true or false to pick result [OK]
Common Mistakes:
  • Choosing numeric value instead of string result
  • Confusing 'High' and 'Low' outputs
  • Assuming calculation causes error
4. Identify the error in this Tableau calculation: IF [Profit] > 0 THEN 'Gain' ELSE 'Loss'
medium
A. Missing END keyword to close IF statement
B. Incorrect field name 'Profit'
C. Using ELSE instead of ELSEIF
D. No error, calculation is correct

Solution

  1. Step 1: Check IF statement syntax

    Tableau IF statements must end with END keyword to close the block.
  2. Step 2: Verify the calculation

    The calculation lacks END at the end, causing a syntax error.
  3. Final Answer:

    Missing END keyword to close IF statement -> Option A
  4. Quick Check:

    IF statements need END keyword [OK]
Hint: Always end IF with END keyword [OK]
Common Mistakes:
  • Forgetting END keyword
  • Assuming ELSEIF is required here
  • Thinking field name is wrong without checking
5. You want to create a calculation in Tableau that classifies customers as 'Top' if their total sales are above the average sales of all customers, and 'Other' otherwise. Which calculation correctly achieves this?
hard
A. IF SUM([Sales]) > TOTAL(AVG([Sales])) THEN 'Top' ELSE 'Other' END
B. IF SUM([Sales]) > AVG(SUM([Sales])) THEN 'Top' ELSE 'Other' END
C. IF [Sales] > AVG([Sales]) THEN 'Top' ELSE 'Other' END
D. IF SUM([Sales]) > WINDOW_AVG(SUM([Sales])) THEN 'Top' ELSE 'Other' END

Solution

  1. Step 1: Understand the need for comparing to average sales

    We want to compare each customer's total sales to the average total sales across all customers.
  2. Step 2: Identify correct Tableau functions

    WINDOW_AVG(SUM([Sales])) computes the average of total sales over the window (all customers), which is correct here.
  3. Step 3: Check other options

    IF SUM([Sales]) > AVG(SUM([Sales])) THEN 'Top' ELSE 'Other' END uses AVG(SUM([Sales])) which is invalid syntax. IF [Sales] > AVG([Sales]) THEN 'Top' ELSE 'Other' END compares row-level sales to average, not total sales. IF SUM([Sales]) > TOTAL(AVG([Sales])) THEN 'Top' ELSE 'Other' END misuses TOTAL with AVG.
  4. Final Answer:

    IF SUM([Sales]) > WINDOW_AVG(SUM([Sales])) THEN 'Top' ELSE 'Other' END -> Option D
  5. Quick Check:

    Use WINDOW_AVG for average over all customers [OK]
Hint: Use WINDOW_AVG for average across all rows [OK]
Common Mistakes:
  • Using AVG(SUM()) which is invalid
  • Comparing row sales to average without aggregation
  • Misusing TOTAL function with AVG