0% found this document useful (0 votes)
29 views19 pages

Power BI 101 Relationship

Power BI 101 Relationship

Uploaded by

yogesh pawar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views19 pages

Power BI 101 Relationship

Power BI 101 Relationship

Uploaded by

yogesh pawar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Power BI 101

Relationships
in Power BI

1
Relationships in Power BI

1. One-to-One [1 : 1]

2. One-to-Many [1 : *]

3. Many-to-Many [* : *]
1
1

2
1. One-to-One[ 1 : 1 ]
Consider Denormalization

Each record in Table A corresponds to


exactly one record in Table B, and vice
versa.

Uncommon but powerful in certain


scenarios

If we had a table where each Sale record


had a Unique Corresponding Record in
a details table (e.g., Sale Details], this
1
would be a 1:1 relationship.
1
This type is less common in complex
data models.
3
Before Denormalization

Bridge Tables

Many-to-One (*:1]
One-to-One (1:1]

By Merging the Sales Detail with Sales Fact, we create


a simplified model with all relevant data in one place.

Not Always Needed: In some cases, a one-to-one


relationship is unnecessary and can be a sign of
suboptimal data modeling. It might indicate that two
tables should actually be merged into one.

4
5
Benefits of Denormalization
1. Denormalization can simplify your data
model by merging tables in a One-to-
One relationship, improving
performance but potentially introducing
some redundancy and complexity.
2. Simplified Model: Fewer tables to
manage.
3. Improved Performance: Faster queries
by reducing joins.
4. Easier Data Retrieval: All relevant data
in one table.

6
When to Use

1. When you need a simpler model

for performance reasons.

2. When data volume is manageable


and redundancy is acceptable.

3. Identify opportunities to
denormalize and streamline your
tables for improved efficiency.

7
Drawbacks

1. Data Redundancy: Potential for

increased storage and

inconsistencies.
2. Data Integrity: Harder to maintain

consistency.
3. Scalability Issues: Large tables can
become unwieldy.

8
2. One-to-Many [ 1 : * ]

The [Products-Customer-Store] Dim

tables [One side] relate to the [Sales

Fact] table [Many side].


Each Sale record is linked to one

[Product-Customer-Store], but each


[Products-Customer-Store]can appear
in many Sales records.
1
1

9
One-to-Many [ 1 : * ]

The “One” Side Should Have Unique


Values [Primary Key], While The “Many”
1
Side Can Have Duplicates.
1

10
One-to-Many [ 1 : * ]

This Is The Most Common Type Of


Relationship

It is used for scenarios where a Single


Record [Products-Customer-Store] can be
associated with Multiple Records [e.g., Sales]

Best Practice:

Ensure that the one side of the


relationship has unique values [primary
key], and the many sides can have
1
duplicate values1[foreign key].

11
3. Many-to-Many [ * : * ]
Happens when multiple records in one table can
relate to multiple records in another.
1. Students and Courses
A student can enroll in multiple courses, and a
course can have multiple students.

2. Salespeople and Regions


A supplier can supply multiple products, and a
product can have multiple suppliers.

3. Doctors and Patients


A doctor can treat multiple patients, and a patient
can have multiple doctors.
4. Books and Authors
A book can have multiple authors, and an author
can write multiple books.

12
Many-to-Many [ * : * ]
The Products Table To The Stores Table,
With The Product-Store Bridge Table. Each
Product Can Be Available In Multiple Stores,
And Each Store Can Stock Multiple Products

Bridge Table

13
Why is it a Problem in Power
BI?

In Power BI, Many-to-Many


Relationships can lead to issues
like Ambiguous joins and
incorrect Aggregations.
However, there are several
strategies to overcome these
challenges.

14
How to manage Many-to-
Many relationships
Students and Courses
Scenario: A student can enroll in multiple courses, and a
course can have multiple students (many-to-many).
1. Using a Bridge Table (Junction Table)

15
How to manage Many-to-
Many relationships
Scenario: A salesperson can operate in multiple
regions, and a region can have multiple salespeople.
Instead of maintaining a many-to-many relationship
between Salespeople and Regions, Aggregate the data
to summarize the number of sales per region.

2. Aggregating Data to Remove Duplicates


Aggregated Table:

Summarize sales by RegionID (total sales, average


sales, etc.).

16
How to manage Many-to-
Many relationships
Aggregating Data to Remove Duplicates

Now, the relationship between


Salespeople and the aggregated table
will be one-to-many (one salesperson to
many aggregated regions).

17
Key Takeaways
Use Star Schema Whenever Possible

Keep Relationships One-to-Many

Avoid Many-to-Many Relationships

Use Single Directional Filters

Eliminate Unnecessary Relationships

Create Relationships Based on Surrogate Keys

Leverage Power BI’s Relationship Diagram View

Optimize Cardinality

Maintain Clean and Well-Documented Models

18
Thank You!

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy