A star schema organises data for analysis with a fact table at the centre holding events and numbers, such as invoice lines, surrounded by dimension tables such as customer, product, date and region. This structure makes dashboards fast, formulas simple and results trustworthy.
- Fact tables hold numbers and events; dimension tables hold descriptions.
- The most important decision is the grain of the fact table.
- A date table with months, quarters and fiscal year is essential in every model.
- In Power BI a star schema is usually faster and simpler than large flat tables.
A star schema is the most widely used way to organise data for analysis and dashboards. A central fact table holds measurable events, and several dimension tables describe them: date, product, customer, unit and so on. Drawn on paper, the structure looks like a star, which is where the name comes from.
Why the data model matters so much
Most slow dashboards and conflicting numbers are caused by the data model, not the tool. When everything is dumped into one wide table, or tables are joined without a clear logic, formulas become complex, calculations slow down and filters behave unpredictably. The star schema solves this with a simple rule: events in the middle, descriptions around them.
Fact tables and dimension tables
| Feature | Fact table | Dimension table |
|---|---|---|
| Content | Events and numeric values | Descriptive attributes |
| Examples | Sales, production, downtime, financial transactions | Date, product, customer, line, cost centre |
| Row count | Large and growing | Relatively small and stable |
| Columns | Dimension keys and measures | Key and attributes |
| Role in reports | Sum, average, count | Filter, group, slice |
The most important decision: grain
Before building a fact table, define exactly what one row represents, for example "one item on one invoice" or "one line's output in one shift". An unclear grain leads to double counting and numbers that never reconcile with finance. The practical rule is to keep the lowest level of detail the source provides; you can always aggregate, but you cannot recover lost detail.
The date dimension
The date table must reflect how the business actually runs: fiscal year, working days and public holidays. In the GCC that often means the Hijri calendar alongside the Gregorian one, in Iran the Persian calendar, and in Turkey local public holidays. Without it, "this month vs the same month last year" or "fiscal year to date" will be inaccurate.
Star or snowflake?
In a snowflake schema, dimensions are split into further sub-tables. That saves some space but makes reports slower and formulas more complex. For management dashboards, especially in Power BI, the star schema is almost always the better option.
Common modelling mistakes
- Joining two fact tables directly instead of through shared dimensions.
- Using bi-directional and many-to-many relationships without need.
- Storing product or customer names as text in the fact table instead of keys.
- Relying on volatile source codes instead of surrogate keys.
- Missing master data management, so one product appears under several codes.
A sample sales model
| Table | Type | Sample columns |
|---|---|---|
| FactSales | Fact (one row per invoice line) | Date key, customer key, product key, rep key, quantity, amount, discount, cost |
| DimDate | Dimension | Date, fiscal month, quarter, fiscal year, weekday, holiday flag (and local calendar where needed) |
| DimCustomer | Dimension | Code, name, customer type, city, region, credit limit |
| DimProduct | Dimension | Item code, description, group, brand, unit |
| DimSalesRep | Dimension | Rep code, name, supervisor, route |
With this model, questions such as “net sales by product group in Q3 by region compared with last year” are answered with a simple formula in a fraction of a second.
Historical changes in dimensions (SCD)
If a customer moves from the east region to the west, which region does last year's sales belong to? The answer depends on company policy and must be chosen consciously:
- Type 1 (overwrite): all past sales move to the new region; simple, but history is lost.
- Type 2 (versioning): a new customer row with validity dates is created; past sales stay with the previous region and regional performance is fair.
These decisions are part of the design in our data warehousing service. For the basics see what is a data warehouse.
Steps to design a star schema
- Finalise the management questions and KPIs.
- Identify business processes (sales, production, maintenance) as fact tables.
- Define the grain of each fact table.
- Identify and conform shared dimensions.
- Define measures once, in the model layer, so every report uses the same formula.
Frequently asked questions
What is a star schema?
A way to organise analytical data with a central fact table of numeric events surrounded by descriptive dimension tables.
Do we need a star schema in Power BI?
For performance and accuracy, yes. Power BI is optimised for star schemas, and filters and DAX calculations behave predictably in that structure.
What does grain mean in a fact table?
Grain defines exactly what each row represents, for example one line on an invoice. A clear grain prevents double counting.
How many rows can a fact table have?
From thousands to hundreds of millions. With a proper star schema, columnar compression and pre-aggregations, even very large tables respond quickly in dashboards.
Can a model have several fact tables?
Yes. Several fact tables (for example sales, budget and inventory) can share dimensions such as date and product; this is sometimes called a galaxy schema and is very useful for budget versus actual.












