Bird
Raised Fist0
Tableaubi_tool~15 mins

Line charts in Tableau - Real Business Scenario

Choose your learning style10 modes available
Scenario Mode
👤 Your Role: You are a sales analyst at a retail company.
📋 Request: Your manager wants to see how monthly sales have changed over the past year to understand trends and seasonality.
📊 Data: You have a dataset with sales transactions including Date, Product Category, and Sales Amount.
🎯 Deliverable: Create a line chart showing total sales for each month over the last 12 months.
Progress0 / 8 steps
Sample Data
DateProduct CategorySales Amount
2023-07-15Electronics1200
2023-07-20Clothing800
2023-08-05Electronics1500
2023-08-18Clothing700
2023-09-10Electronics1300
2023-09-22Clothing900
2023-10-03Electronics1600
2023-10-15Clothing850
2023-11-07Electronics1700
2023-11-20Clothing950
2023-12-01Electronics1800
2023-12-12Clothing1000
1
Step 1: Connect your Tableau workbook to the sales data source containing Date, Product Category, and Sales Amount columns.
No formula needed; just connect the data source.
Expected Result
Data source is connected and visible in Tableau.
2
Step 2: Create a calculated field to extract the month and year from the Date column for grouping sales by month.
Create calculated field named 'MonthYear' with formula: DATETRUNC('month', [Date])
Expected Result
A new field 'MonthYear' that shows the first day of each month for each date.
3
Step 3: Drag 'MonthYear' to the Columns shelf to set the horizontal axis as months.
Drag 'MonthYear' field to Columns.
Expected Result
Months appear on the horizontal axis in chronological order.
4
Step 4: Drag 'Sales Amount' to the Rows shelf to set the vertical axis as total sales.
Drag 'Sales Amount' field to Rows and ensure aggregation is SUM.
Expected Result
Vertical axis shows total sales amount for each month.
5
Step 5: Change the mark type to 'Line' to create a line chart showing sales trends over time.
In Marks card, select 'Line' as the mark type.
Expected Result
A line chart appears showing total sales for each month connected by lines.
6
Step 6: Add tooltips to show exact sales values when hovering over points on the line.
Ensure 'Sales Amount' is in Tooltip shelf.
Expected Result
Hovering over any point on the line shows the total sales for that month.
7
Step 7: Format the x-axis to show month names and year for clarity.
Right-click 'MonthYear' axis, select Format, set date format to 'MMM yyyy'.
Expected Result
X-axis labels show months like 'Jul 2023', 'Aug 2023', etc.
8
Step 8: Add a chart title 'Monthly Sales Trend - Last 12 Months' and ensure the chart is clear and readable.
Double-click title area and type the title.
Expected Result
Chart has a clear title describing the data shown.
Final Result
Monthly Sales Trend - Last 12 Months

Jul 2023 |─────●─────
Aug 2023 |       ●───
Sep 2023 |        ●──
Oct 2023 |         ●─
Nov 2023 |          ●
Dec 2023 |           ●

Y-axis: Total Sales Amount
X-axis: Month-Year
✓Sales show an increasing trend from July to December 2023.
✓December has the highest sales, likely due to holiday shopping.
✓There is a steady rise in Electronics sales contributing to overall growth.
Bonus Challenge

Create a line chart that compares monthly sales trends for Electronics and Clothing categories side by side.

Show Hint
Use 'Product Category' as a color or detail field in the line chart to show separate lines for each category.

Practice

(1/5)
1. What is the primary purpose of a line chart in Tableau?
easy
A. To show trends over time or ordered data
B. To display proportions of categories
C. To compare individual values without order
D. To show relationships between two categorical variables

Solution

  1. Step 1: Understand line chart usage

    Line charts are designed to show how data changes over time or ordered sequences.
  2. Step 2: Compare with other chart types

    Other charts like pie or bar charts serve different purposes such as proportions or category comparisons.
  3. Final Answer:

    To show trends over time or ordered data -> Option A
  4. Quick Check:

    Line charts = trends over time [OK]
Hint: Line charts = trends over time or ordered data [OK]
Common Mistakes:
  • Confusing line charts with pie charts
  • Using line charts for categorical comparisons
  • Ignoring the order or time aspect
2. Which of the following is the correct way to create a continuous line chart in Tableau?
easy
A. Drag a continuous date field to Columns and a measure to Rows
B. Drag a measure to Columns and a dimension to Size
C. Drag a dimension to Rows and a measure to Color
D. Drag a discrete date field to Columns and a measure to Rows

Solution

  1. Step 1: Identify continuous date usage

    Continuous date fields create smooth, connected lines in Tableau.
  2. Step 2: Understand discrete vs continuous

    Discrete dates create separate marks; continuous dates create a continuous axis for line charts.
  3. Final Answer:

    Drag a continuous date field to Columns and a measure to Rows -> Option A
  4. Quick Check:

    Continuous date + measure = line chart [OK]
Hint: Use continuous date fields for smooth lines [OK]
Common Mistakes:
  • Using discrete dates for line charts
  • Placing dimensions on Color instead of axis
  • Confusing measure placement
3. Given a dataset with sales over months, what will happen if you drag Order Date (continuous) to Columns and SUM(Sales) to Rows in Tableau?
medium
A. A bar chart with sales for each month
B. A pie chart showing sales proportions
C. A scatter plot of sales vs. months
D. A smooth line chart showing sales trend over months

Solution

  1. Step 1: Analyze continuous date on Columns

    Continuous dates create a continuous axis, ideal for line charts.
  2. Step 2: Analyze SUM(Sales) on Rows

    SUM(Sales) aggregates sales values to plot points connected by lines.
  3. Final Answer:

    A smooth line chart showing sales trend over months -> Option D
  4. Quick Check:

    Continuous date + SUM(Sales) = line chart [OK]
Hint: Continuous date + measure = smooth line chart [OK]
Common Mistakes:
  • Expecting bars instead of lines
  • Confusing continuous with discrete dates
  • Misinterpreting aggregation effect
4. You created a line chart but see disconnected points instead of a line. What is the most likely cause?
medium
A. Using a continuous date field on the Columns shelf
B. Using a discrete date field on the Columns shelf
C. Placing a measure on Color instead of Rows
D. Not aggregating the measure

Solution

  1. Step 1: Identify effect of discrete date

    Discrete dates create separate marks for each date, causing disconnected points.
  2. Step 2: Contrast with continuous date

    Continuous dates create a continuous axis, connecting points with lines.
  3. Final Answer:

    Using a discrete date field on the Columns shelf -> Option B
  4. Quick Check:

    Discrete date = disconnected points [OK]
Hint: Discrete dates cause disconnected points [OK]
Common Mistakes:
  • Assuming continuous dates cause disconnected points
  • Ignoring aggregation importance
  • Misplacing measures on Color
5. You want to compare sales trends for multiple product categories over time in one line chart. Which approach is best in Tableau?
hard
A. Place Category on Columns, continuous Order Date on Rows, and SUM(Sales) on Label
B. Place discrete Order Date on Columns, Category on Rows, and SUM(Sales) on Size
C. Place continuous Order Date on Columns, SUM(Sales) on Rows, and Category on Color
D. Place continuous Order Date on Rows, Category on Color, and SUM(Sales) on Tooltip

Solution

  1. Step 1: Use continuous date for smooth time axis

    Continuous Order Date on Columns creates a smooth timeline axis.
  2. Step 2: Use SUM(Sales) on Rows for measure values

    SUM(Sales) on Rows plots sales values vertically.
  3. Step 3: Use Category on Color to separate lines

    Category on Color differentiates multiple lines by color for easy comparison.
  4. Final Answer:

    Place continuous Order Date on Columns, SUM(Sales) on Rows, and Category on Color -> Option C
  5. Quick Check:

    Continuous date + measure + color by category = multi-line chart [OK]
Hint: Use color to separate lines by category [OK]
Common Mistakes:
  • Using discrete dates causing broken lines
  • Placing category on Rows instead of Color
  • Not using continuous date for time axis
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard