Dashboards & BI
Star schema explained: facts, dimensions and grain for business analysts
Part of our guide to business analyst tools.
What a star schema is: facts in the middle, dimensions around them
A star schema is a simple data model designed for reporting rather than for running day-to-day transactions. It has two kinds of tables. When you draw it, one table sits in the middle and the others connect to it like the points of a star. That is where the name comes from.
Fact tables hold the measurements
A fact table records events from one business process: a sale, a payment, a support call, a delivery. Each row holds numbers you want to add up or average, called measures (quantity, amount, duration), plus keys that point to the dimension tables. Fact tables are usually long and narrow: many rows, few columns.
Dimension tables hold the context
A dimension table describes the who, what, where and when of each event. A product dimension holds product name, category and brand. A date dimension holds day, month, quarter and financial year. A store dimension holds store name, city and region. Dimension tables are usually short and wide: fewer rows, many descriptive columns.
The link between them is a key. Each dimension row has a unique key, and the fact table stores that key as a foreign key. In reports, dimensions become your filters, slicers and row labels. Facts become the numbers in the cells.
- If you would sum, count or average it, it probably belongs in a fact table.
- If you would filter, group or label by it, it probably belongs in a dimension.
- If you cannot decide, ask what one row of the fact table means. That question leads you to grain.
Grain: decide what one row means before anything else
The grain is a one-sentence statement of what a single row in a fact table represents. For example: one row per product line on a till receipt, or one row per store per day, or one row per support ticket status change. Everything else in the design depends on it.
Grain decides which questions the data can answer. If the grain is one row per product line on a receipt, you can report sales by product, by hour, by till and by store. If the grain is one row per store per day, you can never see which products sold, because that detail was summed away before it reached the table.
Grain also protects you from double counting. Every measure in a fact table must be true at the declared grain. If you put a monthly store target on every receipt line, a report that sums the target will multiply it by the number of lines. This is one of the most common reporting bugs, and it starts as a modelling decision, not a dashboard error.
A good rule: pick the lowest sensible grain the source data supports. You can always add detail up into totals. You cannot split a total back into detail.
Why a star schema helps reporting
Operational systems store data in many small, linked tables so that each fact is saved once and updates are safe. That is good for running the business, but a simple question like sales by region by month might need joins across many tables. A single flat spreadsheet-style table goes the other way: easy to read, but heavy, repetitive and easy to break when a description changes.
A star schema sits in between. The benefits for reporting are practical:
- Simpler queries. Each question needs one fact table and a few joins, which you can read and check yourself with basic SQL.
- Consistent numbers. Measures are defined once, so two dashboards that use the same fact table should agree.
- Better performance. BI tools such as Power BI are built to work well with this shape. Microsoft's star schema guidance explains why.
- Reusable dimensions. One date or product dimension can serve several fact tables, so filters behave the same everywhere.
- Easier conversations. Business people already think in numbers and descriptions, so the model maps directly to their questions.
Three ways to hold the same data
| Aspect | Operational tables | One flat table | Star schema |
|---|---|---|---|
| Main purpose | Run daily transactions safely | Quick one-off analysis | Repeatable reporting and dashboards |
| Joins needed for a report | Many, across linked tables | None | A few, from the fact to each dimension |
| Repeated descriptions | Very little | A lot, on every row | Stored once in each dimension |
| Risk when a name changes | Low | High, many rows to update | Low, change one dimension row |
| Ease for business users | Hard to read | Easy at first, messy as it grows | Easy once the grain is clear |
How to define a star schema as a business analyst
You will rarely build the tables yourself. Your job is to give the BI or data team a clear, tested specification. These steps work whether the team uses Power BI, another BI tool or a data warehouse.
- Start with the business questions. Collect the real questions the dashboard must answer, written in the stakeholder's words. Link each one to a KPI or a decision.
- Name one business process per fact table. Sales, returns, deliveries and targets are different processes. Each usually gets its own fact table.
- Declare the grain in one sentence. Write it at the top of the specification and ask the data team to confirm the source can deliver it.
- List the dimensions. For each fact table, ask who, what, where, when and how. Note the descriptive columns people will filter or group by.
- List the measures and how they add up. For each measure, say whether it can be summed across all dimensions, only some, or none (for example, a stock balance or a rate).
- Write sample rows and test them against the questions. A few made-up rows expose missing dimensions and grain problems faster than any diagram.
- Agree definitions and record decisions. Write down what each measure means and why the grain was chosen, for example in a decision log.
Diagram in words
- 1. Collect business questions: Write the questions in stakeholder language and link each to a KPI or decision.
- 2. Name the business process: Choose one process, such as sales or deliveries, for each fact table.
- 3. Declare the grain: State in one sentence what a single fact row represents.
- 4. Identify dimensions: Ask who, what, where, when and how for every event.
- 5. Define measures: List each number and whether it can be summed across all, some or no dimensions.
- 6. Test with sample rows: Walk a few made-up rows through every question to find gaps.
- 7. Record decisions: Document definitions and grain choices so the team builds the same thing.
Worked example: a sales star schema at Marigold Grocers
Marigold Grocers is a fictional chain of neighbourhood grocery stores. Helena, the sponsor, wants a dashboard showing sales by store, product category and month. Nadia, the business analyst, writes the specification with you.
Business process: till sales. Grain: one row per product line on a till receipt. Dimensions: date, store, product. Measures: quantity and sales amount, both fully additive.
fact_sales: receipt_number, date_key, store_key, product_key, quantity, sales_amountdim_date: date_key, full_date, month_name, quarter, financial_yeardim_store: store_key, store_name, city, regiondim_product: product_key, product_name, category, brand
Nadia writes three sample fact rows to test the design (shown with names instead of keys so they are easy to read):
TEXT
receipt date store product qty sales_amount
1001 3 March Pune Milk 2 ₹120
1001 3 March Pune Bread 1 ₹40
1002 3 March Nagpur Milk 1 ₹60Total sales for the day are ₹220 (₹120 + ₹40 + ₹60). Pune sold ₹160 and Nagpur sold ₹60. Milk sold ₹180 across both stores, from 3 units. Grouping by any dimension gives a sensible answer, so the grain works for Helena's questions.
Then Helena asks for sales against target. Targets are set per store per month, so they do not match the receipt-line grain.
Adding targets without breaking the grain
Marigold Grocers, a fictional grocery chain, during a requirements review for the new sales dashboard.
- Helena Project sponsor
Can we just add a target column to the sales table? Pune's March target is ₹6,000.
- Nadia Business analyst
If we put ₹6,000 on every receipt line, and Pune has 200 lines in March, the dashboard would show a target of ₹1,200,000.
- Helena Project sponsor
That would be badly wrong. So what do we do?
- Nadia Business analyst
We create a second fact table for targets, with one row per store per month. Both tables share the store and date dimensions.
- You The BA learner
So the dashboard sums sales from one table and targets from the other, then compares them by store and month?
- Nadia Business analyst
Exactly. Achievement is sales divided by target. If Pune sells ₹4,500 in March, that is 75% of its ₹6,000 target.
- You The BA learner
And we calculate the 75% in the report instead of storing it, because percentages cannot be summed across stores.
The people and the company in this scene are fictional.
Reading a star schema query
Monthly sales by region
SELECT s.region, d.month_name,
SUM(f.sales_amount) AS total_sales1
FROM fact_sales AS f2
JOIN dim_store AS s ON f.store_key = s.store_key3
JOIN dim_date AS d ON f.date_key = d.date_key3
WHERE d.financial_year = 'FY2025'4
GROUP BY s.region, d.month_name;5
- Measure from the fact. Sales amount is additive at the receipt-line grain, so SUM is safe across any dimension.
- One fact table. The query starts from a single business process, which keeps the meaning of the number clear.
- Join on keys. Each dimension joins to the fact through its key. One join per dimension, nothing more.
- Filter by dimension. Filters use descriptive columns from dimensions, never text copied into the fact table.
- Group by labels. Row labels in the report come from the dimensions, here region and month.
Common star schema modelling mistakes to catch early
Many reporting errors found in testing started as small modelling choices. These are the ones worth checking every time.
- Mixing grains in one fact table. Line-level sales and monthly targets in the same table cause inflated totals. Give each grain its own fact table.
- Never writing the grain down. If people describe one row differently, they will build different measures. Put the grain sentence at the top of the specification.
- Storing rates and ratios as measures. Averages, percentages and margins cannot be summed. Store the parts (sales, target, cost) and calculate the ratio in the report, for example as a measure in Power BI.
- Putting descriptions in the fact table. Product names or store cities on every fact row bloat the table and go out of date. Keep them in dimensions.
- Forgetting history in dimensions. If a store moves to a new region, should last year's sales follow it or stay in the old region? Ask the business and document the rule.
- Missing unknown members. If a fact row has no matching product, an inner join silently drops it. Ask for an unknown row in each dimension so totals still reconcile.
- Building one giant flat table. It feels simpler at first, but every new question adds columns and duplicated text.
- Splitting dimensions into many small tables. Over-normalising (often called snowflaking) brings back the join complexity the star was meant to remove.
Healthy versus risky modelling habits
Good habit
- Declare the grain in one sentence and get it confirmed
- Give each business process and grain its own fact table
- Store the parts of a ratio and calculate it in the report
- Agree how changes to dimension values over time are handled
- Reconcile dashboard totals against a trusted source report
Risky habit
- Start designing visuals before the grain is agreed
- Add a monthly number to a line-level fact table
- Sum a stored percentage or average
- Copy names and descriptions onto every fact row
- Assume an inner join keeps every fact row
Quick review checklist before you sign off a model
Use this list when the BI team shares a model or a draft dashboard. You do not need to read the code to ask these questions.
- Every fact table has a written grain sentence that the business understands.
- Each measure is valid at that grain and its summing rule is documented.
- Every business question maps to one fact table and named dimensions.
- Dimension columns use business-friendly names that match the project glossary.
- There is a plan for unknown or missing dimension values.
- Rules for dimension changes over time are agreed and recorded.
- Dashboard totals reconcile to a trusted source report for a sample period.
If you want to practise this end to end, the BA Lab includes a data and SQL stage and a dashboards stage where you define measures and check them against a fictional company's data.
Frequently asked questions
Do business analysts need to build star schemas themselves?
Usually not. Data engineers or BI developers build the tables. The BA defines the business questions, the grain, the measures, the dimensions and the definitions, then checks that the result answers the questions and reconciles with trusted sources. Knowing the concepts makes those conversations much faster.
What is the difference between a star schema and a snowflake schema?
In a star schema each dimension is one table joined directly to the fact table. In a snowflake schema some dimensions are split into further linked tables, such as product linked to a separate category table. Snowflakes reduce some repetition but add joins, so many BI teams prefer stars for reporting.
Can one dimension be used by several fact tables?
Yes, and it is good practice. A shared date or store dimension, often called a conformed dimension, lets you compare sales, targets and returns side by side, with filters that behave the same way across all of them.
How do I find the right grain if stakeholders are unsure?
Ask for the most detailed question anyone is likely to ask, then check what the source system actually records. Choose the lowest level the source reliably supports. Write sample rows and walk stakeholders through them, because concrete rows are easier to react to than abstract definitions.
Is a star schema the same as a data warehouse?
No. A data warehouse is the overall store of integrated data for analysis. A star schema is one way of shaping tables inside it, or inside a BI tool model such as Power BI. Many warehouses contain several star schemas, one per business area.
This article was written by an AI system and published automatically after automated accuracy, safety and quality checks. All companies, people and numbers in the examples are fictional. BA Mentorship does not issue professional certifications and cannot guarantee any job or interview outcome. Spot an error? Email our support team and we will check and correct it.