0% found this document useful (0 votes)
3 views

IPL_Lesson 3_Creating Table Relationships and Data Models

The document outlines the learning objectives related to data models and table relationships, including definitions and management techniques. It explains how to create, edit, and delete table relationships in Power BI, as well as the concept of cardinality in data relationships. The document concludes with instructions for completing an exercise and preparing for the next class.

Uploaded by

dont sue me
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

IPL_Lesson 3_Creating Table Relationships and Data Models

The document outlines the learning objectives related to data models and table relationships, including definitions and management techniques. It explains how to create, edit, and delete table relationships in Power BI, as well as the concept of cardinality in data relationships. The document concludes with instructions for completing an exercise and preparing for the next class.

Uploaded by

dont sue me
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Official (Closed) - Non Sensitive

CREATING TABLE RELATIONSHIPS AND DATA


MODELS
Official (Closed) - Non Sensitive

LEARNING OBJECTIVE

At the end of today’s lesson, students will learn


 What is a Data Model?
 What is required when creating a Table Relationship
 Model View Interface
 How to Manage Table Relationships?
 What is Cardinality?
Official (Closed) - Non Sensitive

WHAT IS A DATA MODEL?

 A data model is where tables are connected via relationships, based on a common key (Primary key).
The figure below is a data model:
Official (Closed) - Non Sensitive

WHAT IS REQUIRED WHEN CREATING A TABLE RELATIONSHIP

 To create table relationships and data models between multiple data set,
we need to identify what are the common fields.

 Both data sets contain the Product Key field, therefore, we use the
“Product Key” column from the Product Lookup data set and “Product
Key” column from the Sales Data data set as the joining key

 Take a look at the values under the joining key to determine the
cardinality before joining the data
Official (Closed) - Non Sensitive

POWER BI DATA MODEL VIEW

 To manage Table Relationships, you need to


select the ‘Model view”.
 Be sure to be very familiar with the Model
View interface: Model View

a. Menu Ribbon
b. Data / Field List
c. View Options
d. Properties Pane
e. Model Layout tabs
f. Model Canvas
Official (Closed) - Non Sensitive

HOW TO CREATE TABLE RELATIONSHIP

Option 1
Click and drag to connect
common fields within the Model
View
Official (Closed) - Non Sensitive

HOW TO CREATE TABLE RELATIONSHIP

Option 2
 Add or Delete relationships
using the “Manage Relationship”
dialogue box.
 Select the “From table” and “To
Table”
 Select the common field to
join.
 Click “Save” to create the new
relationship.
Official (Closed) - Non Sensitive

HOW TO EDIT TABLE RELATIONSHIP

 Double click on the existing


relationship
 On the “Edit relationship”
dialogue box, make the
necessary changes.
 Click “Save” to update the new
relationship.
Official (Closed) - Non Sensitive

HOW TO DELETE TABLE RELATIONSHIP

 Right click on the existing relationship


 Select “Delete” in the pop-up box, to delete the
existing table relationship.
Official (Closed) - Non Sensitive

WHAT IS CARDINALITY

 Cardinality refers to the relationship between rows of data in one table and rows in another set of table
 There are 3 kinds of cardinality:
 One-to-One
 One-to-Many (or Many-to-One)
 Many-to-Many

 In One-to-One cardinality, the values in the joining key column is unique.


 i.e. the Product Key cannot be duplicated in both tables
 In One-to-Many cardinality, the values in the joining key column is unique in one table, but duplicated in the other
table
 In Many-to-Many cardinality, the values in the joining key column is duplicated in both tables
Official (Closed) - Non Sensitive

RELATIONSHIP CARDINALITY
In this example, there is only INSTANCE of each
“town_sht” (e.g. AMK) in the town table (noted by a
“1”, since each row contains the unique town
description (e.g. Ang Mo Kio)

There are MANY instances of each town in the resale-


flat-prices table (noted by an asterisk ‘*’) since multiple
flats are sold in Ang Mo Kio.
Official (Closed) - Non Sensitive

WHAT’S NEXT?

01 02 03
Complete “Exercise 3 – Review Lesson 4 OAL Work on your Individual
Create Table content prior to next Assignment (20%).
Relationships and week’s class.
Models” and submit it to
Brighspace (BS).

2024 BUSINESS ANALYTICS MODULE 12

You might also like