Gomaa Intelligence.Data Hub
عربي

Foundations › Power BI › The Model: Build the Foundation

🧱 The Model: Build the Foundation

Star Schema and Relationships: The Heart of the Model

Lesson 4 / 14· 10 min

Picture an invoice book (sales) next to a product list and a customer list. An invoice holds only the product number, and you look it up in the list to learn its name. That is exactly a Star Schema.

TypeWhat it doesExample
Fact tableRecords events and measurable valuesFactSales: quantity, sales, cost
Dimension tableDescribes events and is used to sliceDimProduct, DimCustomer, DimChannel, DimDate

The usual relationship is one-to-many from the dimension (the 1 side) to the fact (the many side): one product has many sales. The filter flows from dimension to fact, so picking Electronics in a Slicer filters the sales automatically.

Build the model yourself

Drag the key from the fact table to the matching key in each dimension: ProductID, CustomerID, ChannelID and Date. Once all four exist the filters work.

▶ Try DAX
Total Sales = SUM(FactSales[Sales])
Total Cost = SUM(FactSales[Cost])

See how the dimension (product category) filtered the fact table through the relationship. Same measures, different numbers per category.

TermMeaningRule
CardinalityRelationship type: one-to-many or many-to-manyPrefer one-to-many
Cross-filter directionWhich way filters flow: Single or BothStart with Single from dimension to fact
Active/InactiveActive or inactive relationshipOne active relationship between two tables
Advanced For advanced readers: why is many-to-many risky?

When both sides contain repeated values, a filter passes to groups of rows rather than one row, producing unexpected and sometimes inflated numbers. The usual fix: create a unique dimension table (like DimProduct) and link both tables to it.

Now here is a model with one broken relationship. Diagnose it: which relationship is wrong and why?

❓ The best shape for the relationship between DimProduct and FactSales is:

Do it in real Power BI Desktop

Summary
  • FactSales records events and Dim tables describe them.
  • The usual relationship is one-to-many from dimension to fact, and filters flow that way.
  • The dimension key must be unique; avoid Both and many-to-many without a reason.
  • Test the relationship with a simple table before building the dashboard.

Need a real Power BI dashboard for your business?

I design a data model and an executive dashboard fitted to your business and your real data.

Request an analytics service ↗
Get your data analyzed by an expert ↗