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

Exercise Adding a calculated table and column

This document provides instructions for creating a calculated table and columns in Power BI using DAX formulas. It outlines a scenario involving Adventure Works, where the user must analyze sales data without altering the original dataset, and includes steps for downloading data, removing duplicates, establishing relationships, and creating calculated tables and columns. The exercise aims to enhance data standardization and consistency for better analysis and insights.

Uploaded by

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

Exercise Adding a calculated table and column

This document provides instructions for creating a calculated table and columns in Power BI using DAX formulas. It outlines a scenario involving Adventure Works, where the user must analyze sales data without altering the original dataset, and includes steps for downloading data, removing duplicates, establishing relationships, and creating calculated tables and columns. The exercise aims to enhance data standardization and consistency for better analysis and insights.

Uploaded by

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

Exercise Adding a calculated table and

column
Introduction
You should now understand how to use DAX formulas and functions in Power BI to create
calculated tables and columns.

In this exercise, you’ll apply your knowledge of DAX to add a calculated table and column to an
existing dataset.

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

 Create a calculated table from the existing dataset within your data model.
 Add calculated columns to a specific table within the dataset.
 Ensure data standardization and consistency.

Scenario
Adventure Works needs your help to analyze its sales data to generate insights into its sales
performance. However, you must analyze the company’s data without altering the original
dataset. You must also create summary tables and normalize dimension tables for analysis.

The company provides you with an Excel workbook called AdventureWorksData.xlsx. You must
download this file and load it to Power BI to complete your assigned task. Be sure to evaluate the
data quality and configure the model to ensure that Adventure Works can use it to make
informed decisions.

AdventureWorksData
XLSX File

Instructions
Create a new Power BI project called Exercise – Adding a calculated column and table. Follow
the steps below to complete the exercise.

Step 1: Download and connect to the Adventure Works Dataset.


1. Download and save the Excel workbook AdventureWorksData.xlsx. The
workbook contains five data tables: Sales, Date, Products, Region, and
Salesperson.
1. Load the data from the Excel sheet into Power BI. Ensure you load all tables in the
workbook.
2. Open a preview of the table in the Preview pane.

 Tip: You can import data using the Get Data drop-down menu.

Step 2: Remove all duplicate values and set the relationships between
the tables.
1. Remove all duplicate values from the SalesOrderNumber column of the Sales fact
table.
2. Ensure that one-to-many relationships exist between the fact table and all dimension
tables. Once you load the data, Power BI will establish the table relationships
automatically. If any relationship is missing, create it manually.

 Tip: You can view and configure model relationships in Model view of Power BI
desktop. You can create and edit relationships in Manage Relationship view of
Power BI desktop.

Step 3: Create a calculated table.


1. Create a new calculated table called Yearly Sales by Color that contains the
following data:

 All data from the Sales table,


 All Product Color data from the Product table,
 And all Yearly values from the Date table.

1. Note down the total number of columns in the table.

 Tip: Create the calculated table using the ADDCOLUMNS and RELATED DAX
functions. ADDCOLUMNS: Adds calculated columns to the given table or table
expression. You can add columns to the Sales table from the Date and Product table.
Syntax: ADDCOLUMNS(<table>, <name>, <expression>[, <name>,
<expression>]…) RELATED: Returns a related value from another table. You need to
use this function to add Product color from the Product table and Year
information from the Date table to the Sales table to create a new calculated table.
Syntax: RELATED(<column>)

Step 4: Create calculated columns.


1. Create a calculated column in the Date table called Qtr and populate it with data for
each quarter of the year.
2. Create a second calculated column in the Date table called Month and populate it with
the name of each month(Display each month’s name as just the first three letters of each
month’s name).
3. Create a calculated column in the Sales table for Product Color.

 Tip: You can create columns using the New column feature from the table tools tab
of Power BI’s desktop interface, along with the RELATED, MONTH, and QUARTER
DAX functions. You can use the MONTH DAX function to display each month’s name.

Step 5: Save your Power BI project.


 Save your Power BI project to your local computer.
 Tip: Make sure you select an appropriate project name and folder path.

Conclusion
By completing these steps, you’ve successfully created a calculated table by combining data
from multiple datasets and user-defined columns using DAX. You can now analyze Adventure
Works data based on the analytical and business requirements.

When using DAX formulas, always ensure they are correctly formatted and that the column
names match the actual column names in your data.

You might also like