Designing and Validating a Business Star Schema
A practical guide to defining fact-table grain, designing a business star schema, configuring relationships, and validating reporting behavior.
Start with the business process and grain
Start with the business process and grain
Choose one business process—such as sales, orders, inventory, or customer service—and state in plain language what one row in its fact table represents. This definition is the grain. Set it before choosing columns, measures, or dimensions, so every row and field fits the same level of detail.
For example, a sales fact table might have one row per product line on a posted sales order. An order containing three products then produces three fact rows. That is not the same grain as one row per order, one row per daily product total, or one row per shipment. Each answers different questions; mixing them in one fact table can make the data inconsistent for analysis.
Check sample source records against the declared grain. Identify the event represented and its unique identifier—for instance, an order ID together with a line number. Also decide how corrections, returns, and cancellations are recorded in relation to that grain. These events need a defined treatment; otherwise, rows may not consistently represent the business process you intended to measure.
Shape the facts, dimensions, and measures
Shape the facts, dimensions, and measures
Once the grain is fixed, arrange the model as a star schema: a central fact table holds transactional observations and foreign keys, while surrounding descriptive dimensions provide fields for filtering and grouping. In the sales example, FactSales could contain date, product, customer, and salesperson keys; OrderID and LineNumber identify the source order line. Quantity and NetSalesAmount are measures, with the net amount defined according to the business’s agreed meaning.
Dimensions provide the descriptions used to filter and group those observations. For example, DimDate can contain date, month, quarter, year, and fiscal period; DimProduct can contain product name, brand, and category; and DimCustomer can contain name, segment, and region. Each dimension row needs a unique key, and its attributes should describe the entity—not an individual fact row. Surrogate keys can keep warehouse keys controlled when source identifiers change or dimension history is tracked.
Load one fact row per declared grain and distinct, keyed entities into the dimensions. As you prepare the model, remove unintended duplicate dimension keys and standardize data types. Check that each fact foreign key resolves to the intended dimension row. For missing or unmatched source keys, follow a defined unknown-member or other documented policy rather than silently dropping facts. Reporting dimensions can also present readable labels and hierarchies—for example, product category and brand together—even if the source database stores those descriptions across several normalized tables.
Choose measures for how they aggregate. Quantities and sales amounts are usually additive across products, customers, and dates. A rate such as unit price generally should not be summed. When appropriate, calculate a weighted average from the totals, such as total sales / total quantity, rather than averaging or summing row-level prices without regard to quantity. Finally, define a consistent business convention for returns, such as recording negative sales, separate transactions, or another specified treatment.
Connect the model with clear relationships
Connect the model with clear relationships
In a star schema, each dimension’s unique key normally connects to the matching foreign key in the fact table as a one-to-many relationship: one dimension member can relate to many fact rows. In Power BI, the usual filter path is from dimension to fact. A product category filter, for example, narrows the product members and then the related sales rows.
Before relying on these paths, check that each dimension key is unique and that related key columns have compatible data types. Keep relationships active when they represent the default reporting path. Avoid bidirectional filtering by default: it can create ambiguous paths, especially when fact tables or shared dimensions provide multiple routes. Use it only when the model requires it and its effects are understood.
A fact table may include different date roles, such as order date and ship date. In the usual Power BI pattern, only one relationship between a date dimension and that fact table can be active at a time. An inactive relationship can support a specific measure, or separate role-playing dimensions—clearly labeled Order Date and Ship Date, for example—can let users filter by both roles simultaneously. Choose and label the approach so it is clear which date a report filter controls.
Validate the model against reporting questions
Validate the model against reporting questions
Test whether dimension filters reach the intended fact rows by trying representative questions. For sales by product category this year, group by DimProduct[Category] and filter by DimDate[Year]; check that category subtotals add to the total under the same date filter. To find units by customer segment in a region, group by segment, apply the region filter, and verify that both affect the result. To report by ship month rather than order month, check that the ship-date role or measure is being used. For returns, compare a period with known returns against source records and the agreed accounting convention.
Do not treat a plausible grand total as proof that the model is correct. Check detail rows as well as totals: errors in grouping or filter propagation can be hidden by an apparently reasonable total. Compare small filtered results with a trusted source query or a manually checked sample, and reconcile additive measures to source totals. Check rates such as unit prices to confirm they are not being summed as though they were additive.
Also test edge cases: duplicate dimension keys; blank or unmatched fact keys and their unknown-member handling; dimension members with no matching facts; first and last reporting dates, fiscal versus calendar years, and transactions with missing dates; and return behavior. A dimension member without sales may display a blank or zero depending on the visual and measure, so confirm which is appropriate. If a slicer behaves unexpectedly, inspect active relationships, filter direction, and bidirectional paths. Test each slicer alone and in combination to reveal conflicting paths or filters that fail to affect the intended visual.