DEV Community

Gabriel Mbuva
Gabriel Mbuva

Posted on

Power BI: Modelling, Schemas, Joins and Relationships

Power BI is a data visualization and business intelligence tool designed for business professionals with varying levels of data knowledge. Power BI's dashboard can be used to report and visualize data in a wide range of styles, including charts, graphs and more. It allows everyone from beginners to experts to easily see what is happening in their business and make faster, smarter decisions.

Data Modelling

Data modelling is the process of organising, structuring, and defining relationships between your data table. It uses diagrams, symbols, and textual definitions to visually represent how data is captured, stored and used.

Reasons for data modelling
Seamless Data Exploration: Builds clear hierarchies and drill-down paths. This lets report consumers quickly navigate tables to uncover hidden trends.

Maximum Query Performance: Directly dictates how fast your reports load. Clean modeling prevents redundant data and messy relationships from delaying visual renders.

Guaranteed Report Accuracy: Secures the consistency, dependability, and integrity of your source records. This ensures decision-makers are always working with precise insights.

Simplified DAX Writing: Keeps your Data Analysis Expressions short and clean. Well-structured tables eliminate the need for complex, unmaintainable override formulas.

Schemas

Schemas refer to the logical structure and organization of your data model. In Power BI we have two types of schemas; Star and snowflake schema.

Star Schema: Is the most widely recommended and optimal design in Power BI. The center of the star is a Fact Tables which contains measurable, quantitative data, for example, sales revenue, quantity sold, or transaction amounts. The fact tables contain foreign keys that link to dimension tables. Dimension tables form points of the star. They provide descriptive context for the facts. Dimension tables contain primary keys and are used to filter and group data in your reports.

Snowflake Schema: Is an extension of the star schema. In a snowflake schema, dimension tables are normalized, which means they are broken down into further sub-dimension tables. It reduces data redundancy but requires more complex relationships between tables, which can decrease query performance in Power BI.

Joins

A join is a method used to merge tables together to combine information based on a shared column.
Different types of joins in Power BI include:

Left Outer: Returns all rows from the left table and matching rows from the right table.

Right Outer: Returns all rows from the right table and matching rows from the left table.

Full Outer: Returns all rows from both tables, regardless of whether there is a match.

Inner: Returns only the matching rows present in both tables.

Left Anti: Returns only rows from the left table that have no match in the right table.

Right Anti: Returns only rows from the right table that have no match in the left table.

Relationships

Relationships are logical connections between tables based on shared columns. They are the foundation for a data model, enabling visuals to slice, filter, amd aggregate data seamlessly across multiple data sets.

Types of Relationship Cardinality
Cardinality defines the nature of the relationship between two tables:

One-to-Many: The most common and recommended relationship. One row on the "one" side relates to multiple rows on the "many" side . Filters flow strictly from the "one" side to the "many" side.

Many-to-Many: Occurs when both tables have multiple rows matching the shared key. These are generally not recommended because they create unpredictable filter paths, unreliable totals, and performance bottlenecks.

One-to-One: Both tables contain only one unique row for the related key. Used infrequently; usually suggests the data should have been merged into a single table initially.

Top comments (0)