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

2_Design_and_develop_the_data_model

The document outlines an exercise for designing and developing a data model using Power BI, focusing on sales data for Tailwind Traders. It includes steps for creating relationships between various tables, configuring a calendar table, and generating a calculated table for sales in USD. The exercise aims to enhance skills in data modeling and reporting for global sales insights.

Uploaded by

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

2_Design_and_develop_the_data_model

The document outlines an exercise for designing and developing a data model using Power BI, focusing on sales data for Tailwind Traders. It includes steps for creating relationships between various tables, configuring a calendar table, and generating a calculated table for sales in USD. The exercise aims to enhance skills in data modeling and reporting for global sales insights.

Uploaded by

Dishank Agrawal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Exercise: Design and develop the data

model
Introduction
As you’ve worked with Power BI, you've seen first-hand how data can tell stories to inform
insights. In this exercise, you’ll put this knowledge into practice by working with sales data
from around the globe to prepare a report.

By completing this exercise, you’ll demonstrate your ability to:

• Construct a snowflake schema tailored for the data model.


• Establish and specify the relationships between various tables in the data model.
• Define a dedicated calendar table for temporal data analysis and reporting.
• Synthesize DAX data into a consolidated US Dollar table encompassing sales and
profit metrics.

Case study
Tailwind Traders needs a report that shows the company’s worldwide sales and profits.
However, the sales and profit data must be displayed in US dollars. Let’s help Tailwind
Traders create this report so that it can generate insights into its global sales.

Instructions
Open the Tailwind Traders Report.pbix Power BI file you have created in the previous
exercise. Access Model View in Power BI to view the report's tables. Your Power BI
environment should resemble the screenshot below. Follow the prompts to design and
develop a data model from these tables.
Step 1: Create a relationship between the Countries and Exchange Data tables

1. Create a relationship between the Countries and Exchange Data tables on the Exchange
ID field.

2. Set the Cardinality to One to One (1:1)

3. Set the Cross filter direction to Both to be bi-directional.

4. Ensure the Make this relationship active checkbox is selected.

5. Inspect the relationship arrow in the Model View to ensure the arrows point in both
directions and display a 1:1 symbol on either end of the connector.

Step 2: Create a relationship between the Sales and Countries tables

1. Create a relationship on the Country ID field between the Sales and Countries tables.

2. Set the Cardinality to Many to One (1:1).

3. Set the Cross-filter direction to Both so that it’s bi-directional.

4. Ensuring the Make this relationship active checkbox is selected.

5. Inspect the relationship arrow in the Model View to ensure the arrows point in both
directions and display a *:1 symbol on either end of the connector.

Step 3: Create a relationship between the Purchases and Sales tables

1. Create a relationship on the OrderID field between the Purchases and Sales tables.
2. Set the Cardinality to One to One (1:1).

3. Set the Cross filter direction to Both to be bi-directional.

4. Ensure the Make this relationship active checkbox is selected.

5. Inspect the relationship arrow in the Model View to ensure the arrows point in both
directions and display a 1:1 symbol on either end of the connector.

Step 4: Configure the Calendar table

• Select New Table and add the following DAX code to create a new Calendar table:

CalendarTable =

ADDCOLUMNS(

CALENDAR(DATE(2020, 1, 1), DATE(2023, 12, 31)),

"Year", YEAR([Date]),

"Month Number", MONTH([Date]),

"Month", FORMAT([Date], "MMMM"),

"Quarter", QUARTER([Date]),

"Weekday", WEEKDAY([Date]),

"Day", DAY([Date])

Step 5: Create a relationship between the Calendar and Purchases tables

1. Create a relationship on the Date field between the Calendar and on Purchase Date in the
Purchases table.

2. Set the Cardinality to Many to One (1:1).

3. Ensure the Make this relationship active checkbox is selected.

4. Inspect the relationship arrow in the Model View to ensure the arrows point in both
directions and display a *:1 symbol on either end of the connector.

Step 6: Create a Sales in USD calculated table


1. Select New Table and add the following DAX code to create a new calculated table:

Sales in USD =
ADDCOLUMNS(
Sales,
"Country Name", RELATED(Countries[Country]),
"Exchange Rate", RELATED('Exchange Data'[ExchangeRate]),
"Exchange Currency", RELATED('Exchange Data'[Exchange Currency]),
"Gross Revenue USD", [Gross Revenue] * RELATED('Exchange
Data'[ExchangeRate]),
"Net Revenue USD", [Net Revenue] * RELATED('Exchange
Data'[ExchangeRate]),
"Total Tax USD", [Total Tax] * RELATED('Exchange Data'[ExchangeRate])
)

2. Note the Gross Revenue USD, Net Revenue USD, and Total Tax USD for the Order
ID= 1035 on the Sales in USD table.

Step 7: Create a relationship between the Sales in USD and Sales tables

1. Create a relationship between the Sales in USD and Sales tables on the Order ID field.

2. Set the Cardinality to Many to One (1:1).

3. Ensuring the Make this relationship active checkbox is selected.

4. Inspect the relationship arrow in the Model View to ensure the arrows point in both
directions and display a 1:1 symbol on either end of the connector.

Conclusion
Having completed the assigned tasks, you have demonstrated the skills to design and develop
a data model!

You might also like