Data Modeling

Power BI · Data Modeling

Theory

Data modeling is the step where you decide how tables relate so Power BI can filter and aggregate correctly across them. In Model view each table is a box, and a relationship is a line between a key column in one table and the matching column in another. When a user picks a value in one table, for example City = Jaipur in Customers, the filter travels along the relationship to Sales and every measure shows only Jaipur's orders.

A good model is small, clear and shaped as a star schema: a central fact table of events (Sales) surrounded by dimension tables that describe them (Customers, Products, Date). Good modeling also means correct data types, hiding technical key columns from report authors, sorting month names by month number, and writing measures instead of relying on implicit sums. Most slow or wrong reports trace back to a weak model, not to the visuals.

Why we use it

The model decides whether totals are right and visuals are fast. With clean relationships, one simple measure like SUM(Sales[Amount]) works correctly for any slice: region, city, category or month.

When to use it

Model as soon as you have more than one table, before building visuals. Avoid the shortcut of merging everything into one huge flat table; it duplicates data, grows the file and makes DAX harder.

How it works

  1. Tables loaded into the model
  2. Identify fact tables (events) and dimensions (descriptions)
  3. Create one-to-many relationships from dimensions to facts
  4. Any many-to-many or bidirectional links? Yes: Rethink the design, add a bridge or dimension. No: Keep single-direction filters.
  5. Hide keys, set sort orders and data types
  6. Model ready for measures and visuals

Syntax

Model view → drag Sales[CustomerID] onto Customers[CustomerID]
Or: Home → Manage relationships → New
Properties: Cardinality | Cross filter direction | Make this relationship active
Column properties: Hide in report view | Sort by column | Data category

Example

Sample model setup:
1. Customers[CustomerID] 1 → * Sales[CustomerID]
2. Products[ProductID] 1 → * Sales[ProductID]
3. 'Date'[Date] 1 → * Sales[OrderDate]; mark 'Date' as the date table
4. Hide Sales[CustomerID], Sales[ProductID] and Sales[OrderDate] (use the dimension columns instead)
5. Measure: Total Sales = SUM(Sales[Amount])
Now Customers[City], Products[Category] and 'Date'[Month] all slice [Total Sales] correctly.

Key points

Power BI topics

Power BI Introduction

Getting Data

Power Query (Data Transformation)

Data Modeling

DAX (Data Analysis Expressions)

Data Visualization

Dashboards & Reports

Power BI Service

Advanced Features

Projects & Case Studies

Interview & Certification

Advanced DAX & Time Intelligence

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Power BI Dashboards & DAX

Learn data visualization and interactive dashboards step-by-step. Click any topic in the sidebar to open it right here.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice DAX Online 250 business scenarios on a star schema — write a measure and compare your visual with the expected one. Start practising →
Section {{ sec.num }}

{{ sec.label }}

Power BI  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
On screen — where to click

{{ rich.ui.title }}

{{ u.text }}
  1. {{ st.n }}{{ st.text }}
{{ rich.ui.title }}
{{ u.text }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax / Where to find it
{{ current.syntax }}
Example
{{ current.example }}
What You'll Learn — click to check off
  • {{ pt.mark }} {{ pt.text }}

Share this topic