Ravindra BagaleCourses & study guides Track your progress

Guides

Fact Tables and Dimension Tables in Power BI

Fact tables store events and numbers (each sale line, each phone-bill payment). Dimension tables store the things you slice by (store, product, calendar). Facts stay skinny; labels live once on dimensions.

Friends! Beginners paste City Name on every sales row. Why is that painful? Rename one city and you edit a thousand lines. How? We separate FreshBasket facts (Amount + keys) from Store and Product dimensions, then relate them. RELATED pulls the label when a column needs it.

Quick answer

Vertical path:

  1. Fact rows = events: keys + Amount + Qty.
  2. Dimension rows = entities: Store ID + City + Channel.
  3. Do not copy City onto every fact row if Store already has it.
  4. Relate fact keys to dimension keys.
  5. Slice on dimension columns; measures sum the fact.
  6. Use RELATED on the fact only when you truly need a denormalised column.

Real example: sales slips vs store card

Fact — what happened (grain = one slip line):

OrderID StoreID ProductID Amount
A S1 P1 100
A S1 P2 50
B S2 P1 40

Dimension Store — who / where:

StoreID City Channel
S1 Mumbai Online
S2 Pune Store

Dimension Product — what:

ProductID Name
P1 Rice
P2 Oil

Phone-bill cousin (also a fact): Month key, StoreID, BillAmount. Still an event table. City still comes from Store.

What a City slicer = Mumbai does:

  1. Dimension keeps S1.
  2. Fact keeps orders A lines (100+50).
  3. Order B leaves.
  4. Total 150.
  5. City was never stored twice on the fact.

What do I need before this guide?

Before and after (look at the tables first)

Before fact dimension split Denormalised city on fact rows.

Before

After fact dimension split City on dimension; fact stays skinny.

After

How to recognise each

Fact Rows A fact table holds events: each sale line, with amounts and foreign keys. Fact Rows A fact table holds events: each sale line, with amounts and foreign keys.

A fact table holds events: each sale line, with amounts and foreign keys.

Dim Lookup A dimension table holds things you slice by: City, Product name, Calendar month. Dim Lookup A dimension table holds things you slice by: City, Product name, Calendar month.

A dimension table holds things you slice by: City, Product name, Calendar month.

  1. Fact — grows forever (new orders every day). Numeric measures live here.
  2. Dimension — grows slowly (new stores, new products). Text labels live here.
  3. Date — special dimension with one row per day.
  4. If a column answers “which / who / when label?”, it is usually dimensional.
  5. If a column answers “how much / how many for this event?”, it is usually factual.
Fact Dim Join Facts stay skinny (keys + numbers). Labels live on dimensions. That is why RELATED works. Fact Dim Join Facts stay skinny (keys + numbers). Labels live on dimensions. That is why RELATED works.

Facts stay skinny (keys + numbers). Labels live on dimensions. That is why RELATED works.

Why RELATED exists: sometimes a calculated column on Sales wants RELATED ( Store[City] ). The relationship is the bridge. Prefer slicing on the dimension column over stuffing every label into the fact.

Grain (say it every time)

  1. Fact grain = “one row means what?” — one order line, not one order header if lines differ.
  2. Wrong grain duplicates totals when you relate poorly.
  3. Count orders with DISTINCTCOUNT of OrderID, not COUNTROWS of lines, when lines are the grain (count guide).

Mistakes and calm fixes

Symptom Likely cause Fix
City repeated 10k times Label on fact Move to dimension
Totals explode Grain / relationship wrong Check one-to-many keys
Slicer on fact text No dimension Build dimension; relate
RELATED blank Missing relationship / wrong side Model view check

Ravindra Bagale's Tip

Interview line: “Facts hold events and numbers; dimensions hold labels I slice by. I keep facts skinny and relate on keys.” Got it?

Practice task

  1. Take a flat shop export.
  2. Split into Sales + Store + Product.
  3. Prove Mumbai total 150 with a slicer.
  4. Write the fact grain in one sentence.

Learn it properly

Course lesson:

Related: Star schema · RELATED

Got it? Fact = events and numbers; dimension = slice labels. Keep facts skinny. That closes this batch of ten guides — not deployed. Let us go ahead.

Frequently asked questions

What is a fact table?

A table of events or measurements — sales lines, tickets, phone-bill payments — with keys and numbers.

What is a dimension table?

A lookup table of entities you filter by: store, product, customer, calendar.

Why not one wide sheet?

Repeating “Mumbai” on every line wastes space and makes renaming a city painful. Dimensions store the label once.

Is Date a dimension?

Yes. A proper Date table is the usual dimension for time intelligence.

Can a table be both?

In messy imports, sometimes. In a clean model you separate them so grain stays clear.

Course lesson?

Fact tables and dimension tables, in the data modelling chapter.