DEV Community

Rachel Muriuki
Rachel Muriuki

Posted on

SCHEMAS AND DATA MODELLING IN POWER BI

PowerBI is a powerful tool for turning raw data into insightful reports.
In power BI tables show what data you have, relationships show how it connects and schema shows why it all fits together.

Data Model

A data model defines how your tables connect and interact in Power BI. It tells Power BI:
-Which tables hold raw facts eg. Sales
-Which tables describe those facts eg. Products

Fact Tables

They store measurable, quantitative data such as Sales transactions.
They contain numeric columns like Revenue, Quantity and contain foreign keys such as ProductID, CustomerID.

Dimension Tables

They contain descriptive textual information that adds context to facts
Examples of such columns:
-Customers
-ProductName
-Category

Relationships

PowerBI connects fact and dimension tables through relationships using shared keys like ProductID

Types oF relationships:

i)One-to-Many

One record in a dimension connects to many in a fact table
Example: One Customer can make many orders

ii)Many-to-One

Multiple records in one table are connected to a single record in another table
Example:Multiple cities belong to one state

iii)Many-to-Many

Used when both tables can have repeating values
Example: A student can take many courses and each course has many students

Schemas

Schema is how your tables are arranged and linked together

Star Schema

It's simple, looks like a star and yet powerful
One central fact table (eg. Sales) connects directly to dimension tables (eg.Customers, Products, Regions)
It is easy to understand, performs fast, ideal for slicing and filtering

Snowflake Schema

It adds extra detail tables branching off the dimensions
Used to avoid repeating data and save space
The only limitations are that it involves more tables and relationships, resulting to slow performance.

Why Good Modelling Matters

It ensures accurate visuals and measures that show correct results
It simplifies DAX queries and reduces processing time
It's easy to add new data sources later
It offers clarity to anyone reviewing your model
It's easy to maintain incase of issues

A well designed schema ensures reports load quickly, calculations stay accurate and business users can explore data confidently.

Top comments (0)