Skip to main content

Module 2: Tables, Grain, and Why Dashboards Lie Slides

Slide walkthrough for Module 2 of Production Analytics Engineering with dbt: Metrics, Semantic Layers & Lineage: Learn the most important beginner...

This slide page is the visual review companion for the full course module. Use it to recap the architecture, examples, exercises, production warnings, and takeaways after reading the lesson.

Slide Outline

  1. Tables, Grain, and Why Dashboards Lie - Learn the most important beginner concept: one row per what?
  2. Learning Objectives - 3 outcomes for this module
  3. Why This Module Matters - Grain means what one row represents. Most bad metrics come from joining tables with different grains and then aggregatin
  4. The Mental Model - Lesson section from the full module
  5. Tiny Example - Lesson section from the full module
  6. Interactive Check - Lesson section from the full module
  7. Inline Practice Lab - Lesson section from the full module
  8. Self-Check Quiz - Lesson section from the full module
  9. Real-World Use Cases - Reliable executive dashboards that do not disagree across teams, AI analytics agents that query governed metrics instead of guessing SQL
  10. Common Mistakes to Avoid - 3 mistakes covered
  11. Production Notes - 1 practical notes
  12. Inline Exercises - 1 inline exercise
  13. Key Takeaways - 3 points to remember

Learning Objectives

  • Define table grain accurately
  • Spot double-counting bugs before they reach dashboards
  • Understand facts, dimensions, and event tables

Why This Module Matters

Grain means what one row represents. Most bad metrics come from joining tables with different grains and then aggregating without noticing the duplication.

Production Notes

  • Add model descriptions that start with grain: "One row per..." This prevents many review mistakes.

Common Mistakes

  • Summing order-level values after item-level joins
  • Assuming unique IDs without testing them
  • Mixing event time and reporting time without naming the difference

Key Takeaways

  • Always state grain before aggregating
  • One-to-many joins are the main source of dashboard lies
  • Facts and dimensions are useful because they make grain explicit

Inline Exercises

  1. Find the Grain

    Identify the grain of five sample tables and decide whether each can be safely joined before aggregation.

    30-45 minutes - Beginner

    • Label raw_orders as one row per order
    • Label raw_order_items as one row per order item
    • Label raw_customers as one row per customer
    • Explain why orders to order_items is one-to-many
    • Write the safe aggregation rule

    Inline lab: complete the exercise directly in the course page.

Read the full module | Back to course curriculum