DEV Community

Cover image for Modeling, Joins, Relationships and Different Schemas In Power BI
PHILIP KAPLONG
PHILIP KAPLONG

Posted on

Modeling, Joins, Relationships and Different Schemas In Power BI

In my 4th week of learning about data, Power Bi was one of the tools i had to learn how to use and the more dug into learning it, the more it got more interesting.

Power BI is simply a tool that turns boring spreadsheets and business data into easy-to-understand charts, dashboards, and reports so people can quickly see what's happening and make better decision.

The best segment was learning about different types of schemas and how they are constructed,how to model your data so different pieces of information can work together,what are joins and diffrent types of joins and also different types of relatioships.

At 1st they seem like normal words but when you dig into the technical part on what they do everything changes to magic.

SCHEMAS

When it comes to data modelling ,a schema is the way tables are organised and connected.

1.STAR SCHEMA

A star schema simply has one central table(Fact table) that is connected to several smaller tables(Dimension table)
This tables are connected using the foreign keys and primary keys.A Primary Key is a unique ID that identifies each record in a table, while a Foreign Key is that same ID stored in another table to create a connection between the two tables.

2.SNOWFLAKE SCHEMA

A snowflake schema is similar to a schema but dimensiuon tables are split into smaller related tables
It always good for reducing data duplication but is more complex as compared to a star schema

JOINS

Joins is simply a way of linking tables together so related information can be viewed in one place.

Different types of Joins in Power BI:

1.Inner Join - Only rows that exist in BOTH tables.
2.Left Outer Join - All rows from left table plus matching rows from right table.
3.Right Outer Join - All rows from right table plus matching rows from left table.
4.Full Outer Join - All rows from BOTH tables regardless of match.
5.Left Anti Join-Returns rows from the left table only where no matching row exists in the right table.
6.Right Anti Join-Returns rows from the right table only where no matching row exists in the left table.

Relationships

A relationship in Power BI is a connection between two tables using a common column, allowing data from both tables to work together

Power BI Relationship Types (One-Liners)
1.One-to-One (1:1) – One record in Table A matches exactly one record in Table B.
2.One-to-Many (1:*)– One record in Table A can match many records in Table B.
3.Many-to-One (*:1) – Many records in Table A can match one record in Table B.
4.Many-to-Many (:) – Many records in Table A can match many records in Table B.

1.One-to-one (1:1) Relationship

2.One-to-Many (1:*) Relationship

3.Many-to-Many (:) Relationship

Top comments (0)