跳到正文

第 24 课 · Projects and Reference

Project: Sales Dashboard

Build a Sigma sales dashboard step by step: check data, build a data model and metrics, add KPIs, charts and controls, test security and publish safely.

Now you combine the course into one project: a weekly sales review for regional managers. You can follow along in a Sigma account with sample or invented data, or practice the logic with the stand-ins. Never use real customer data in a practice workspace.

The brief

  • Users: regional sales managers and the head of sales.
  • Decision: where to focus this week.
  • Questions: How are sales this month? Which regions are behind? Which products drive the change?
  • Freshness: daily.
  • Access: managers see only their region; the head sees all.

The data

Use three small tables.

Table Grain Key columns
order_lines One line per product on an order order_id, order_date, region, product_id, qty, price, status
products One row per product product_id, name, family
targets One row per region and month region, month, target

Step 1: check the data

Before building anything, check uniqueness, unmatched keys and odd values.

SQL Stand-in: data quality checks and base totals

Press Run (or Ctrl + Enter) to see the result here.

You find an unknown product, P9. Do not drop it: use a left join (or a relationship) and label it "Unmapped". Decide that cancelled lines are excluded from revenue, and write that down.

Step 2: build the data model

  1. Create a data model with order_lines as the detailed table.
  2. Add a many-to-one relationship to products on product_id, after confirming that product keys are unique.
  3. Add a column Line revenue = [Qty] * [Price].
  4. Add metrics:
TEXT
Revenue       SumIf([Line revenue], [Status] != "cancelled")
Orders        CountDistinctIf([Order ID], [Status] != "cancelled")
Avg order     [Revenue] / [Orders]
  1. Apply row-level security using a user attribute, with a manager exception (see security).
  2. Publish, then test with a manager role.

These formulas use invented column names. Adjust them to your own data, and decide how a missing status should be treated.

Step 3: base table

In the workbook, add a table from the model on a data page. Create a Month column with DateTrunc("month", [Order Date]). Add the related family column, and create a Family label column that replaces a missing value with Coalesce([Family], "Unmapped").

Step 4: targets

Targets are at region and month level, while order lines are more detailed. Do not join targets to lines and then sum the targets: the target would repeat on every line. Instead, build a table grouped by region and month, then add the target with a Lookup:

TEXT
Target:        Lookup([Targets/Target],
                      [Region], [Targets/Region],
                      [Month],  [Targets/Month])
Attainment:    If(Zn([Target]) = 0, Null, [Revenue] / [Target])

Check that both month columns hold the same type of value, such as the first day of the month.

SQL Stand-in: attainment without repeating targets

Press Run (or Ctrl + Enter) to see the result here.

Step 5: the page

Zone Elements
Header Title, definitions, data freshness note
Controls Date range, region (for the head), family
KPIs Revenue, orders, average order, attainment
Trend Revenue by week (line)
Breakdown Attainment by region (bar), revenue by family (bar)
Detail Grouped table by region and product

Point shared controls at the base table. Set the default date range to the current month to date, and compare with the same days of the previous month. Attainment against a monthly target needs a clear label when the month is not finished.

Step 6: interaction

Add an action: selecting a region bar sets the region control, and a button clears it. Add a short hint so readers know the bars are clickable. The region control is only a convenience; row-level security still protects the data.

Step 7: test

  • Does revenue equal the checked source total, excluding cancelled lines?
  • Does the "Unmapped" family show the P9 line?
  • Do targets appear once per region and month?
  • Does a manager see only their region, including in totals and exports?
  • Do controls with no results show something sensible?
  • Is the page fast enough, and is the freshness need met without waste?

Step 8: release

Publish, preview as a viewer, tag a first approved version, share with teams and set an owner. Schedule an export only if people truly need it.

Extensions

  1. Add a year-to-date running total with a calendar table.
  2. Rank products within each region.
  3. Add a linked input table where managers comment on regions below target.

Common mistake: declaring the dashboard finished after it looks right once. Save your check queries and run them again after each data or model change.

Handing it over

Write a short note for the person who will maintain the dashboard. Include the decision it supports, the source tables, the metric definitions, the security rule, the check queries and the known limits, such as unmapped products. Then ask that person to make one small change in a draft and run the checks. This quickly shows what your note still leaves out.

Explaining your results

Before the first meeting, practice saying what the page shows in three sentences: where sales stand against the target, which region or product explains most of the gap, and what you do not know yet. Avoid claiming a cause that the data cannot show. A chart can tell you that revenue fell in one region, but not why. Treat possible reasons as questions for the people who know that region.

Keep a copy of the numbers you presented, for example in a tagged version. If a figure changes later because late data arrived or a definition was corrected, you can explain the difference instead of guessing.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. How should the unknown product P9 be handled?

    Keeping it preserves revenue and shows the data problem.
  2. 2. Why not join targets directly to order lines and sum them?

    That fan-out inflates the target.
  3. 3. Which check best verifies security?

    Security must be tested with limited roles across all outputs.
  4. 4. What is a good definition habit?

    A written, shared definition keeps numbers consistent.

Summary

  • Start from a brief and check data quality first.
  • Put relationships, metrics and security in a data model.
  • Aggregate before adding coarser targets.
  • Build a clear page with controls, actions and definitions.
  • Test totals, access and performance before release.

Next: Project: Budget vs Actual Planner

你的学习进度保存在此浏览器中,无需账号。