Home Tutorials Power BI Tutorial Data modeling
Data modeling

Data modeling


Data Relationships in Power BI

Description: Data modeling is the process of connecting different tables so that Power BI can treat them as a single, cohesive dataset. A relationship is established when you link a common field between two tables, allowing filters applied to one table to automatically affect the other.

Why: In real-world scenarios, data is rarely stored in one giant table. You might have one table for "Sales" and another for "Product Details." Relationships allow you to analyze these together, such as seeing the "Category Name" from the Product table alongside the "Total Revenue" from the Sales table.


How Relationships Work

Relationships are created by connecting a Key (matching field) between tables. For example, linking Sales[ProductID] to Products[ProductID] tells Power BI that these records belong to the same entity.

Relationship Type Description
One-to-Many (1:*) The most common type. One product (the "One" side) can appear in many different sales transactions (the "Many" side).
Directionality Represented by an arrow, this shows which way the filter flows. Usually, filters flow from the "lookup" table down to the "transaction" table.

Example Scenario

The Sales Connection:

If you connect a Product table (containing names and costs) to a Sales table (containing quantities) using the ProductID, you can create a chart that displays "Total Profit by Category." Power BI uses the relationship to look up the category for every sale made.

The Star Schema Design

Description: The Star Schema is the industry-standard "best practice" for organizing data in Power BI. It involves separating your data into two distinct types of tables: Fact Tables and Dimension Tables. When organized correctly, the model looks like a star, with the Fact table in the center and Dimension tables radiating outwards.

Why: Designing your model as a star schema makes your reports faster, your DAX formulas simpler, and your data much easier to manage. It prevents "circular dependencies" and ensures that filters behave predictably.


Fact vs. Dimension Tables

To build a star schema, you must categorize your tables based on what they contain:

Table Type Characteristics Examples
Fact Table Contains quantitative data (numbers) and observations. It is usually "long and thin." Sales, Temperature readings, Stock levels, Transaction IDs.
Dimension Table Contains descriptive data (text) used to filter or group the facts. It is usually "short and wide." Date/Calendar, Customers, Product Categories, Store Locations.

Key Notes

  • Simplicity: Always try to avoid "Snowflake" schemas (where dimensions connect to other dimensions). Keeping your model as a Star reduces the "distance" a filter has to travel to get to your data.
  • Performance: Power BI’s engine is specifically optimized for Star Schemas. Using this design ensures that your visuals load quickly even as your dataset grows to millions of rows.
  • The Date Dimension: Every Star Schema should include a dedicated Date table. This allows you to perform "Time Intelligence" (comparing this year's sales to last year's) with ease.

🏋️ Test Yourself With Exercises

Take our quiz on Data modeling to test your knowledge.

Browse Quizzes »