DEV Community

Cover image for Schemas and data modelling in Power Bi, a begginers guide.
Mutuku joseph
Mutuku joseph

Posted on

Schemas and data modelling in Power Bi, a begginers guide.

Introduction to Power Bi.

Power BI is a data analysis and visualization tool by Microsoft that helps turn raw data into charts, graphs, and reports.
In this beginner friendly guild line I will take you through all the essentials to get you started on your data journey.

In this article I will take you through schemas and data modelling in Power BI, focusing on concepts such as star schema, snowflake schema, relationships, fact and dimension tables, and why good modelling is critical for performance and accurate reporting.

Schemas and Data modelling in Power bi

Data modelling -this the action of setting up data tables, relationships, calculations and scenario building.
So technically, a date model is semantic layer for power Bi reports.

Key definitions to note early on;
Relationship- this defines all tables and how they relate with each other
physical model- is actually a representation of how data is stored in the database
logical model is a representaion of how bussiness interpret this stored data

Fact table-stores numerical data used for analysis
Dimesnion table- stores descriptive information, normally reffering to data in the facts table.

Schemas
In very simple terms, a schema is the organization of data. A representation of how the database is setup
We will the look at types of schemas, namely Star schema and snowflake schema.

Star schema
Is a simple blueprint that consists of one or more fact tables that are referencing a number of dimension tables.

Use this visualized image to understand further, at the center is how fact table, sorrounded by a number of dimension tables

Nb That kind of arrangement gives this database structure the name,star schema

Snowflakes schema
This is an extension of the star schema. additional dimension tables are create from existing dimensions, it adds additional dimensions to represent hierarchies in the data. This reduces redundancy hence the model is more efficient.

_Fact table _
From the definition above, a fact table-stores numerical data used for analysis

Lets use a practical example of student data, how would a star schema of the database look like;

Relationships
This defines all tables and how they relate with each other. usually a fact table to dimensional tables using columns from each other
Therefore applying the relationship model we can filter multiple data values from a relationship of tables
There are 3 types of relationships

1 to 1 whereby a column has only one instance of a value and other related table has only one instance of that value.

Many to 1 - whereby, we have more than one instance of a value. and other related table has only one instance of that value

**Many to many **a connection of many-to-many relationship between the table in this relationship

Normalized model, is whereby we create more tables with fewer columns. this reduces redundancy and inconsistences
-maintains data integrity
optimizes disk space

denormalized model-
we have fewer tables and more columns and records

Snowflakes schema
Is the extension of a star schema, whereby dimension tables have dimension tables.

Good modelling is critical for performance and accurate reporting.It ensures accuracy in analysis.
A well structured model even in growing data environment reduces loading time, reduces incorrect results and creates trustworthy interactive reports.

Enjoy your modelling journey

Top comments (0)