Data Models in Power BI
Great dashboards start with a great data model. Star schemas, relationships, measures, and dimensions β the foundation of Power BI reporting.
What is a data model?
A data model is the blueprint telling Power BI how tables connect.
Three spreadsheets: Sales, Products, Stores. The model maps βProductID in Sales matches ProductID in Products.β Without this map, Power BI canβt combine data.
Good model = fast, accurate reports. Bad model = wrong numbers.
Star schema
The most common pattern: a central fact table surrounded by dimension tables.
- Fact table (centre): Measurable events β numeric values and foreign keys
- Dimension tables (points): Descriptive attributes for filtering
Priyaβs FreshMart model:
- Sales (fact): DateKey, StoreKey, ProductKey, Quantity, Revenue, Cost
- Date (dim): DateKey, Month, Quarter, Year
- Product (dim): ProductKey, Name, Category, Brand
- Store (dim): StoreKey, StoreName, City, Region
| Feature | Fact Tables | Dimension Tables |
|---|---|---|
| Contains | Measurable events | Descriptive attributes |
| Row count | Very large (millions+) | Small (thousands) |
| Key columns | Foreign keys + measures | Primary key + descriptions |
| Examples | Sales, Orders, Deliveries | Date, Product, Store |
Measures vs calculated columns
| Measures | Calculated Columns | |
|---|---|---|
| When | Query time (dynamic) | Data refresh (stored) |
| Example | Total Revenue = SUM(Sales[Revenue]) | Profit = Revenue - Cost |
| Best for | Aggregations with filters | Row-level calculations |
Hierarchies
Drill-down paths: Year β Quarter β Month β Day. Users click to drill from yearly to monthly.
Exam tip: data model concepts
- βCentral table with numeric measuresβ β Fact table
- βDescriptive attributes for filteringβ β Dimension table
- βYear β Quarter β Monthβ β Hierarchy
- βSUM that changes with filtersβ β Measure
- βRecommended schemaβ β Star schema
Flashcards
Knowledge check
Priya's Sales table has DateKey, StoreKey, ProductKey, Quantity, Revenue. What type?
Total revenue changes when a user selects a region filter. This uses:
Next up: Choosing the Right Visualization β which chart tells which story?