ConradBI home

Home  /  How-to  /  Model your data

Star schema basics

Understand facts, dimensions and the grain, so you can plan a model before you build one.

The short version

  • A fact holds the numbers of a business event, such as a sale. A dimension holds the words you describe those numbers with: where, what, who and when.
  • The grain says what one row of the fact stands for. In this guide, one order line.
  • Put the fact in the middle and the dimensions around it, and you have a star schema.
  • In ConradBI, a grain element defines the rows, dimension elements hold the descriptions, and a Basic Fact joins them and holds the measures.
  • Every dimension gets a key of its own and an unknown member, so no sale goes missing when a code doesn't match.
Back to How-to guides
In this guide
  1. What a star schema is
  2. Facts, dimensions and the grain
  3. Why a star schema
  4. How ConradBI builds one
  5. The running example
  6. Keys and the unknown member
  7. One dimension, several facts
  8. Plan your model
  9. When something goes wrong

What a star schema is

A star schema is a way to lay out data for analysis. It splits your data into two kinds of table. One holds the numbers. The others hold the words you slice those numbers by.

Picture your orders. Each order line has numbers you want to add up: units, revenue, cost. It also has a site, a product, a customer and a date. You never add up a site. You group by it, filter by it and label your charts with it.

So the numbers go in one table in the middle, the fact. Each kind of description goes in a table of its own around it, a dimension. Drawn on paper, the dimensions sit around the fact like the points of a star, which gives the layout its name.

If you have built a pivot table in Excel, you know the idea already: the values area holds the numbers, and the rows, columns and filters hold the descriptions.

The method comes from Ralph Kimball, whose book The Data Warehouse Toolkit made it a common way to model data for reporting. ConradBI follows it and uses its words, such as degenerate, junk and role playing, which the other guides in this section explain.

Facts, dimensions and the grain

Three ideas carry the whole method.

The grain is what one row of the fact stands for. Decide it first, and say it in one sentence: "one row per order line". Everything else follows from it. A fine grain answers more questions than a coarse one, such as one row per site per day, because you can always add rows up but never split a total apart.

A fact holds the measures: the numbers measured at the grain, such as Units, Revenue and Cost. It also holds a link to each dimension. A few plain columns that describe the row itself, like Channel or Order ID, can stay on the fact too. Kimball calls them degenerate dimensions, and ConradBI calls them degenerate columns.

A dimension holds the descriptions of one thing. Site holds Site Name and Region. Product holds Product Name and Category. It has one row per site, per product, per customer, and each row is kept once, however many sales point to it.

A quick way to sort your columns:

The question Where it goes Example
How much? How many? The fact, as a measure Revenue, Units
Where? A dimension Site: Site Name, Region
What? A dimension Product: Product Name, Category
Who? A dimension Customer: Customer Name, Segment
When? A Date Dimension Order Date: Year, Month Name
Which order, which channel? The fact, as a plain column Order ID, Channel

Why a star schema

  • It is easy to read. Anyone can see where Revenue lives and what it can be grouped by.
  • Each description is kept once. Every chart that groups by Region uses the same list of regions from the Site dimension, spelled the same way.
  • The numbers add up from one place. Every measure is added up from the fact's rows at the grain, so a total by region and a total by month come from the same rows.
  • Dimensions can be shared. Two facts that use the same Product dimension describe products the same way, and can be filtered together on a report.

How ConradBI builds one

Your data comes in through Acquisitions and is cleaned up in Preps. A model then takes three kinds of element, built in this order:

Element group What it does Read more
Grains A Stepped Definition Grain defines the fact's rows: one per order line. It brings the sources together and says which columns are measures, which join dimensions and which stay plain Define the grain
Dimensions A dimension element holds the descriptive columns, one row per site, product or customer. A Date Dimension does the same for dates Build dimensions, Date dimensions
Facts A Basic Fact reads the grain, joins each row to its dimensions and holds the measures Facts and measures

The grain usually does the joining of your sources. Orders Prep, joined with Sites, Products and Customers, gives one row per order line that also carries its site's name, its product's category and its customer's segment. Most dimensions read their columns from the grain. Then the Basic Fact reads the grain again: for each order line it finds the matching row in each dimension and keeps a link to it, next to the measures.

Each element is processed from the ones before it, and visuals read the processed fact. Change the grain or a dimension, and process the fact again before you look at your visuals.

The running example

The guides in this section build one model from a company's order data. Drawn as a star, Sales sits in the middle and each dimension joins to it:

Element What it is Its columns
Sales The fact, in the middle Revenue, Cost, Units, Channel
Site A dimension Site Code, Site Name, Region
Product A dimension Product Code, Product Name, Category
Customer A dimension Customer ID, Customer Name, Segment
Order Date A Date Dimension Date, Year, Quarter, Month Name and more

Behind it:

  • Order Lines is the grain: a Stepped Definition Grain over Orders Prep, one row per order line.
  • Site, Product and Customer are dimensions built from the columns of Order Lines.
  • Order Date is a Date Dimension, one row per day. A second date on each order, Ship Date, plays the same role through a Role Playing Dimension of Order Date.
  • Sales is a Basic Fact on Order Lines. Its measures are Revenue, Cost and Units, each added up with Sum, and it keeps Channel ("Online" or "Store") as a plain column.

It is the same Sales model the DAR-C guide calculates on.

Keys and the unknown member

ConradBI numbers the rows of every dimension. The number is the row's key, a column of its own beside the codes from your data. You see it as the first column of the dimension's data. A Date Dimension calls its key Date Key.

When the fact is built, each order line looks up its site, for example by Site Code, and keeps that site's key in a column named after the dimension: Site Key. Every dimension the fact uses gives it one: Product Key, Customer Key, Order Date Key. Visuals follow these keys to group the fact's numbers by the dimension's columns.

A key is one number however many columns the match takes, and it belongs to ConradBI rather than to your source.

Every dimension also gets one extra row, the unknown member. Its key is −1 and its columns are blank. An order line whose code matches no row of the dimension, or whose code is blank, gets the key −1. Its revenue still counts in every total, and visuals show it under "(blank)". Without it, that line would drop out of anything grouped by site, and your totals by site would not match your grand total.

Tip: When a chart shows "(blank)", look for codes in the grain that the dimension doesn't have. That is the unknown member at work.

One dimension, several facts

A dimension is built once, and any fact can use it. Say you add a second fact, Returns, from the Returns table in Returns.accdb, with one row per returned line. Give it the same Product and Order Date dimensions that Sales uses.

Both facts now describe products the same way: the same names, the same categories, the same keys. On an Interactive Report, a filter on a column of Product narrows every visual whose fact uses Product, so a Sales chart and a Returns chart move together. Kimball calls a dimension shared like this a conformed dimension.

Two Product dimensions, one per fact, would each work on their own. They just wouldn't filter each other's visuals.

Plan your model

Plan on paper before you open ConradTool. It takes a few minutes and saves rebuilding later.

  1. Name the business event you want to measure: a sale.
  2. Write the grain in one sentence: one row per order line.
  3. List the numbers measured at that grain: Units, Unit Price, Cost, Revenue. These become measures.
  4. List the ways people slice those numbers: by site, by product, by customer, by order date. Each becomes a dimension.
  5. List what describes the line itself but needs no table of its own: Order ID, Channel. These stay on the fact.
  6. Check each dimension against the grain. Every order line has exactly one site, one product, one customer and one order date. Something a line can have several of, such as the promotions on an order, can't be a dimension of this fact at this grain.

Then build it in the order of the guides that follow: the grain, the dimensions, the dates and the fact.

When something goes wrong

What you see What to do
A chart shows "(blank)" Some order lines point to the unknown member: their code is blank in the grain, or missing from the dimension. Find those codes and add them to the dimension's source, or fix them in the grain
Totals are bigger than the source's A join in the grain matched an order line to more than one row, so the line appears twice. Check that the code you join on is unique in the element you join
You can't group a measure by a column you expected The column isn't in a dimension the fact uses, and isn't on the fact. Add it to a dimension, or keep it on the fact as a degenerate column
A report filter doesn't reach a visual The visual's fact doesn't use the dimension the filter is on. Use the same dimension on both facts
A visual still shows old numbers Visuals read the processed fact. Process the fact again after changing its grain or dimensions

Missing something?

Tell us what you were trying to do and what this guide didn't answer. We update it with every release.

Write to us

What changed in this guide

  • November 21, 2026: Reviewed against ConradBI 1.2.59.
  • October 31, 2026: First edition, written for ConradBI 1.2.52.