0% complete

Data Visualization using Power BI · Lesson 1 of 3

Power BI Data Model, Relationships, and Star Schema

Design fact and dimension tables so filters and measures produce consistent reports.

Lesson

1. Introduction

A Power BI report depends on a semantic model that defines how records relate. A clear model makes measures reusable across report pages and reduces the chance that a visual silently double-counts data.

2. Understand the concept

A fact table stores events at a declared grain, such as one row per order line. Dimension tables describe entities such as date, product, or region. One-to-many relationships normally flow from a unique dimension key to fact rows; ambiguous relationships need careful modeling.

3. Syntax and interpretation

DimDate[Date] 1 ─── * FactSales[OrderDate]\nDimProduct[ProductKey] 1 ─── * FactSales[ProductKey]\nFactSales grain: one row per order line

The one side should have unique keys, and the fact-table grain should be explicit before measures are defined.

4. Apply it to an analysis

Design fact and dimension tables so filters and measures produce consistent reports. Start with a small, known example and state what each row or value represents. After the transformation, check row counts, types, keys, and units against the original data. If an assumption fails, stop and investigate instead of presenting the output as a valid result.

5. Common mistakes

  • Connecting tables on non-unique keys without understanding the resulting filter behavior.
  • Counting fact rows when the business question asks for distinct entities.

6. Practice task

A fact table contains several product lines per order. Which DAX function counts orders?

7. One possible solution

Use DISTINCTCOUNT(FactSales[OrderID]) after confirming OrderID is the correct order identifier.

8. Summary and next step

Design fact and dimension tables so filters and measures produce consistent reports. Use the next lesson in this module to extend the idea with another technique and a more realistic analysis case.

Visual guide

Working through Power BI Data Model, Relationships, and Star Schema

  1. Step 01 Define

    State the question, data grain, and expected output.

  2. Step 02 Apply

    Use the method and check its assumptions on a small example.

  3. Step 03 Verify

    Reconcile the result and communicate limitations.

Code examples

Define a base measure
TEXT
Total Sales = SUM(FactSales[SalesAmount])
Expected output
Sums sales in the current filter context.
Count distinct orders
TEXT
Orders = DISTINCTCOUNT(FactSales[OrderID])
Expected output
Counts unique orders rather than order-line rows.

Key points

  • Design fact and dimension tables so filters and measures produce consistent reports.
  • Check the result against the stated data definition and a representative example.
  • Record assumptions and report data-quality limitations rather than hiding them.

Check your understanding

Practice

Which approach best applies the ideas in Power BI Data Model, Relationships, and Star Schema?

Your learning progress

Finish this lesson