0% found this document useful (0 votes)
47 views319 pages

Pl300 - Lab Practise

The document outlines a series of activities designed to teach users how to set up and manage data sources in Microsoft Power BI, including connecting to Excel files, inspecting data quality, resolving import errors, and transforming tables. It uses case studies from Adventure Works to illustrate the importance of accurate data analysis and management. The activities culminate in the ability to prepare data for insightful analysis and reporting.

Uploaded by

hensemloo97
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)
47 views319 pages

Pl300 - Lab Practise

The document outlines a series of activities designed to teach users how to set up and manage data sources in Microsoft Power BI, including connecting to Excel files, inspecting data quality, resolving import errors, and transforming tables. It uses case studies from Adventure Works to illustrate the importance of accurate data analysis and management. The activities culminate in the ability to prepare data for insightful analysis and reporting.

Uploaded by

hensemloo97
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/ 319

Module 1

Activity: Set up a data source

Introduction

So far, you’ve reviewed data sources and the different storage modes available to you in
Microsoft Power BI. You’ll now apply the knowledge you’ve gained to create a new
project, connect to a Microsoft Excel data source, and inspect the imported data.

Case study

It’s the end of the financial year at Adventure Works, and the sales director wants to
analyze how different resellers are performing. Maintaining a strong reseller network is
important for boosting sales throughout the year. The sales data for the year has been
received from the sales management system. You’ve been tasked with loading the sales
data into Power BI to begin analyzing the performance of the business.

Instructions

Step 1: Connect to the data source

1. Download the AdventureWorksSales.xlsx dataset.

2. Open Power BI and create a new project.


3. On the Home tab of the ribbon, select Get data and choose Excel workbook.

4. When the file browser opens, select the AdventureWorksSales.xlsx file followed by
Open.
Step 2: Inspect the data in the Power Query Editor

1. In the Navigator window, select the following sheets:

o Customer
o Date
o Product
o Reseller
o Sales
o SalesOrder
o SalesTerritory

2. Select the Transform Data button to load the data into the Power Query Editor.
Step 3: Load the data and inspect in the Table view

1. When the Power Query Editor opens, inspect the data in each of the tables.

2. In the top-left corner of the Power Query Editor, select Close & Apply.

3. Once Power BI has finished loading the data, open the Table view, also referred
to as the Data view. Inspect the data in each of the tables.
4. Save the project to your computer.

Conclusion

By completing this activity, you loaded the Adventure Works sales data into Power BI
using the Excel worksheet connector. This is the first step for Adventure Works in their
data analysis process. As they continue through the process, new insights will be
unlocked, highlighting potential problem areas and new opportunities. As the
organization grows, more connectors may be utilized to introduce additional relevant
data and enhance insights further.
Managing data sources

Introduction

You’re a data analyst at a vehicle manufacturing company, and your day-to-day involves
navigating through a maze of data: sales metrics streaming in from a CRM (Customer
Relationship Management) platform, a flow of customer engagement data from social
media channels, and financial records from accounting systems. However, the sales
data you're analyzing is unexpectedly outdated, leading to skewed insights. Even more
daunting is the responsibility of safeguarding sensitive financial information, ensuring it
doesn't fall into the wrong hands. This is where your expertise in managing Microsoft
Power BI's data sources becomes indispensable.

Learning objectives

This reading aims to assist you in understanding how to change data source settings,
organize data sources into groups, and manage data source permissions in Power BI. By
the end of this reading, you will know how to streamline your workflow by effectively
grouping data sources in Power Query. Additionally, you'll gain insights into safeguarding
sensitive information by managing dataset permissions, ensuring that data security and
compliance are maintained.

Managing data sources

Changing data source settings

Amid your analysis, you discover that the CRM platform has been recently updated, but
the connection in Power BI is still linked to the old version. This misalignment has
resulted in outdated sales metrics being pulled into your reports. By accessing Power
BI's Data source settings, you can quickly update the connection details to align with
the new CRM system. Let’s dive into how this works:

1. First, start by launching Power BI Desktop on your computer. Next, select File in the
top-left corner of the screen.
2. In the dropdown menu, hover over Options and settings, and then select Data
source settings.

3. A new window titled Data source settings will appear. Here, you can view a list of all
the data sources currently used in your Power BI reports. Select the data source you
wish to change.
4. After selecting the data source, select Change Source... to modify its details. If it’s a
database, for instance, you might need to enter a new server name or database name. If
it’s a file like an Excel spreadsheet, you might need to browse to a new file location. The
ability to change data source settings in Power BI is vital for maintaining the accuracy
and relevance of your data analysis.

5. Once you’ve made the necessary changes, select OK to confirm. Power BI will then
validate the new connection. This immediate action corrects the data discrepancy,
ensuring that your sales analysis is based on the latest data, thus, preventing any
erroneous business strategies that might have been formulated based on outdated
information.
Grouping data sources

Next, as you juggle between various types of data, you find that the financial records are
getting mixed up with customer engagement data, causing significant delays in your
analysis process. To address this, you turn to Power BI’s robust organizational
capabilities, particularly the grouping feature in Power Query. Grouping in Power Query
is a fundamental aspect of effective data management. This feature allows you to
categorize data in a way that aligns with your analytical objectives. Understanding its
importance, you initiate the process of grouping your data sources.

1. Firstly, navigate to the Home tab in the ribbon in Power BI Desktop. Select Transform
Data which opens the Power Query Editor. In Power Query Editor, you'll see a list of
queries (datasets) on the left-hand side.
2. Right-click in the blank space or on any query in the Queries pane on the left side.

3. Select New Group from the context menu. This option allows you to create a new
group (folder) to organize your queries.

4. Next, a dialog box will appear, prompting you to name your new group. For example,
you could name it Sales Data or Customer Engagement based on the type of queries
you plan to group.
5. To add queries to your newly created group, simply drag and drop them into the group.

6. You can also right-click on a query, select Move To Group, and then choose the
appropriate group, in this case, Sales Data.

7. In the Queries pane, The Sales table is now present in the Sales Data group. By
categorizing data sources like this, you not only streamline your workflow but also make
it easier for your team to access the right data, enhancing collaboration and efficiency
in your data analysis tasks.
Managing data source permissions

Finally, the financial data you handle includes sensitive information about company
expenses and revenue, which is not meant for wide circulation within the company.
Realizing the risk of unauthorized access, you use Power BI's Manage permissions
feature to restrict access to this dataset.

1. Permission management is available in Power BI Service, so start by logging into your


Power BI account on the web.

2. In your workspace, locate the dataset for which you want to manage permissions.
Hover over the dataset and select the More options ellipsis.
3. In the dropdown menu, select Manage permissions. This will open a new window.

4. A list of users who currently have access to the dataset is listed in the Manage
permissions window.
5. By selecting the ellipsis icon on a record, you can set each user's access level–either
Add Reshare, Add Build, Add Write, or Remove Access.

6. By selecting Remove Access on records, you’re controlling access to data at various


levels. You can ensure that sensitive information is only accessible to authorized
personnel, aligning with data security and compliance regulations.
7. After adjusting the permissions as needed, the changes are applied automatically.
This careful management of permissions not only safeguards confidential information
but also ensures that each team member has the appropriate level of access,
maintaining the security and integrity of your company’s financial data.

Conclusion

Your journey in Power BI is more than a series of tasks; it's a narrative of problem-
solving, innovation, and responsibility. As you continue to navigate through the ever-
evolving landscape of data, remember that each challenge is an opportunity to
showcase your expertise, make a difference, and contribute to the strategic decisions
that drive companies forward. Stand proud in your role as a data analyst, for your work
with Power BI is not just about managing data; it's about shaping the future!
Module 1:

Activity: Analyze a dataset

Introduction

So far, you’ve reviewed how to evaluate data, data statistics, and column properties in
Microsoft Power BI. In this activity, you’ll apply your knowledge of data profiling to
identify irregularities within a dataset.

Case study

At Adventure Works, the warehouse team wants to analyze the current inventory range
and stock levels. They’ve provided you with a dataset but have notified you that there
are currently issues with their inventory system. As a data analyst, you know the
importance of consistent and accurate data. Therefore, you want to evaluate and
inspect the data that the company provided you with.

Instructions

Step 1: Connect to the data source

1. Download the AdventureWorksAnalysis.xlsx dataset.

2. Open Power BI and create a new project.

3. On the Home tab of the ribbon, select Get Data and choose Excel workbook.
4. When the file browser opens, select the AdventureWorksAnalysis.xlsx file.
5. In the Navigator window, select the AdventureWorksAnalysis sheet, followed by
Transform Data.

Step 2: Inspect the data quality in the Power Query Editor

1. When the Power Query Editor opens, select the ProductID column and ensure it
is set to the Whole Number data type.
2. Then, go to the View tab in the ribbon menu. Enable Column quality and inspect
the quality values for the ProductName column. Note that 98% of values in the
column are valid and that 2% of values are empty.

3. Next, enable Column distribution. Inspect the distribution for the StockLevel
column. Note that there are 26 distinct values and 13 unique values. This means
that there are 26 values within this column for the dataset and that 13 of them only
occur once.
4. After that, enable Column profile. Inspect the profile of the StockLevel column.
Note the statistical information in the profile and that the maximum value is
1,200,000. The Adventure Works warehouse cannot store this number of items,
indicating an anomaly in the data.

5. In the top-left corner of the Power Query Editor, select Close & Apply. Save the
project to your computer.
Conclusion

Congratulations! You have successfully inspected the data quality using Power Query
and identified irregularities in the data. As a data analyst, monitoring data quality will
help you ensure the accuracy and consistency of data as you proceed through the data
analysis process.
Module 1:

Activity: Resolve data import errors

Introduction

So far, you’ve revised how to resolve inconsistencies and data quality issues in
Microsoft Power BI. In this activity, you’ll apply your knowledge of the Power Query
Editor to profile and resolve issues before importing data.

Case study

At Adventure Works, the fulfilment team wants to conduct an analysis of recent orders.
The team manager has provided you with the dataset, and you’ve been tasked with
importing it into Power BI. Unfortunately, the team tracks orders manually in an Excel
sheet, which has resulted in human error. You need to evaluate the dataset and resolve
errors before importing it into Power BI.

Instructions

Step 1: Connect to the data source

1. Download the AdventureWorksOrders.xlsx dataset.

2. Open Power BI and create a new project.

3. On the Home tab of the ribbon, select Get Data and choose Excel workbook.
4. When the file browser opens, select the AdventureWorksOrders.xlsx file.

5. In the Navigator window, select the AdventureWorksOrders sheet, followed by


Transform Data.

Step 2: Remove null values

1. When the Power Query Editor opens, go to the View tab in the ribbon menu.
Enable Column quality and inspect the quality values for the Order Quantity
column. Note that 6% of the values are empty, i.e., null.
2. The fulfilment team has informed you that the empty values were caused by
human error and should be replaced with a value of 1. Right-click one of the null
values in the column or the column itself and select Replace Values.

3. In the Replace Values prompt, enter null as the Value To Find and 1 as the value
to Replace With. Select OK and the Power Query Editor updates with the null
values replaced.
4. Note that a new Replaced Value step has been added to the Applied Steps list.

Step 3: Fix data errors in the Order Date column

1. Select the Order Date column.

2. Navigate to the Home tab in the ribbon menu and check the Data Type for the
column. It is currently set to Any, which is incorrect. Change the data type to
Date. This will add a new Change Type1 step to the Applied Steps list. Note that
the column now shows error values. This is due to human error for some values
in this column.
3. The fulfillment team has informed you that these error values should be
05/03/2023. In the ribbon menu, navigate to the Transform tab.

4. Select the dropdown arrow beside Replace Values and select Replace Errors.

5. In the Replace Errors prompt, enter 05/03/2023 as the Value. Select OK, and
the Power Query Editor updates the values.
6. Note that a new Replaced Errors step has been added to the Applied Steps list.

Step 4: Fix data errors in the Order Total column

1. Select the Order Total column. Navigate to the Home tab in the ribbon menu
and check the Data Type for the column. Again, the column data type is set to
Any, which is incorrect.
2. Change the data type to Whole Number. This will add a new step, Change
Type2, to the Applied Steps list. Again, the column shows error values. This is
due to one of the order totals being entered as Three Thousand instead of the
number 3000.

3. In the ribbon menu, navigate to the Transform tab. Again, select the dropdown
arrow beside Replace Values and select Replace Errors. In the Replace Errors
prompt, enter 3000 as the Value.
4. Select OK, and the Power Query Editor will update. Note that a new Replaced
Errors1 step has been added to the Applied Steps list.
Step 5: Import the data

1. Navigate to the Home tab in the ribbon menu and select Close & Apply. Power
BI will process the data and successfully complete the import.

2. Save your project and close Power BI.

Conclusion

Congratulations! You have successfully resolved data import errors using the Power
Query Editor. The data is now ready to be analyzed in Power BI. Working with error-free
data is important to a successful data analysis process.
Module 1:

Activity: Shape and transform tables

Introduction

So far, you’ve reviewed how to create and transform columns in Microsoft Power BI. In
this activity, you’ll now apply your knowledge of Power Query to transform and shape
data in a dataset.

Scenario

At Adventure Works, the CEO wants you to prepare a report on the top products sold in
each sales region. Unfortunately, the system that the sales team is using to track
product rankings has output the data in a format unsuitable to present to the CEO.
Fortunately, you know how to transform the data using Power BI so that it is suitable for
presentation.

Instructions

Step 1: Connect to the data source

1. Download the TopProducts.xlsx dataset.

2. Open Power BI and create a new project.

3. On the Home tab of the ribbon, select Get Data and choose Excel workbook.
4. When the file browser opens, select the TopProducts.xlsx file.

5. In the Navigator window, select the TopProducts sheet and select Transform
Data.

Step 2: Reduce columns and rows

1. When the Power Query Editor opens, select Use First Row as Headers in the
Home tab of the ribbon menu.
2. This will add two steps, Promote Headers and Changed Type1, to the Applied
Steps list.

3. Note that the headers are now the correct headers, based on the first row of
data; Region, Rank 1, Rank 2, and so on.

4. Next, select Remove Rows and then Remove Duplicates.

5. This will add a Removed Duplicates step to the Applied Steps list. The dataset
will now consist of 3 rows.
6. Next, scroll to the last column, ID. Right-click the column name and select
Remove.

7. This will add a Removed Columns step to the Applied Steps list and remove the
column. The data is now ready to be unpivoted into a more appropriate ranking
format.

Step 3: Unpivot the data

1. Navigate to the first column in the data, Region, and select the column. Then
select the Transform tab in the ribbon menu. Select the Unpivot Columns
dropdown and select Unpivot Other Columns.
2. The data is now unpivoted into three columns: Region, Attribute, and Value.

Step 4: Format the data

1. First, rename the Attribute and Value columns. To do this, double-click on the
column name. Rename the Attribute column to Rank and the Value column to
Product. This will add a Renamed Columns step to the Applied Steps list.
2. Next, you must remove the word Rank from each value in the Rank column so that
you can change the column type. To do this, first select the Rank column. Then
select the Extract dropdown in the Transform tab, and select Text After
Delimiter.

3. In the Text After Delimiter prompt, enter a single space (spacebar) as the
delimiter and select OK.
4. The Rank column will now consist of numeric values. However, its data type is still
Text. Select the Data Type button and change its data type to Whole Number.

Step 5: Load the data

1. The data is now ready to be loaded into Power BI. In the Home tab of the ribbon
menu, select Close & Apply.
2. Once the data is loaded, save the project.

Conclusion

Congratulations! You have successfully shaped and transformed the dataset. The data is
now ready for visualization and presentation to the CEO of Adventure Works Good job!
Module 1:

Activity: Table Transformations in Power Query

Introduction

You’ve learned how to transpose tables, select and remove specific rows, and reverse
row order in Power Query. In this activity, you must apply table transformation
techniques to reformat a poorly structured dataset. You’ll begin by walking through the
steps to convert the column-oriented layout to a row-oriented format, selectively keep
relevant columns, and sort them in reverse order. The goal is to efficiently reorganize the
dataset into a format more conducive to analysis and performance.

Case study: Adventure Works and table transformations

Adventure Works faces a challenge with the format of its Customer table in the Sales
dataset. The table presents customer information across columns rather than rows,
making data analysis difficult. Your task is to transform this table by converting the
columns into rows for a more suitable format. You’ll also need to refine the table by
selecting and retaining only essential columns and then sorting these columns in
reverse order to meet specific analytical requirements.

Instructions

Step 1: Transpose the table

For the initial transformation, let’s change the information layout in the Customers
table.

1. Download and launch the TableTransformationsInPowerQuery.pbix and


AdventureWorksFactSales.xlsx files.

2. Next, select on File in the top-left corner of the screen. In the dropdown menu,
hover over Options and settings, and then select Data source settings.

3. A new window titled Data source settings will appear. Here, you'll see a list of all
the data sources currently used in your Power BI reports.

4. After selecting the data source, click on Change Source... to modify its details.
Navigate to the file location of the AdventureWorksFactSales spreadsheet.

5. Once you’ve made the necessary changes, select OK to confirm and Power BI
will validate the new connection.

6. Navigate to the Home tab of the ribbon and select Transform Data to launch the
Power Query Editor.
7. Select the Customer table from the left sidebar. Identify that the field headers
(Customer Key and Customer ID) and all customer information is stored in
columns, instead of rows.

8. To switch the information from rows to columns and vice versa, you need to
perform an action called transpose table. To accomplish this, navigate to the
Transform tab of the ribbon, and select Transpose, from the Table group of
actions.
Tip: Data structured in columns instead of rows significantly reduces the dataset’s
performance and loading speed, as the optimal handling of tables is through its rows.
This layout also makes it harder to sort, filter and analyze the data efficiently, so it’s
always recommended to transpose data in these scenarios.

9. Notice that the column headers are in the first row of the table, needing to be
ascended. Select the Use First Row as Headers option.

10. The information is now stored efficiently on the table, in the optimal layout for
data analysis.
Step 2: Selecting and removing columns

Next, you need to select and remove columns, removing unnecessary columns reduces
the amount of data imported into Power BI. Let’s review the different ways you can
select specific columns from a table in Power Query Editor.

1. From the Home tab of the ribbon, select Choose Columns.

2. You need to remove the Customer Key column. Keep all columns checked,
except from Customer Key, and select OK.
3. This removes the Customer Key column from your table.

4. While pressing the Ctrl button on your keyboard, select the City and State-
Province columns.
5. On the Home tab of the ribbon, select Remove Columns.

6. This removes the selected City and State Province columns from your table.
Tip: When keeping only a limited number of columns compared to the number of
columns you want to delete, there is the Remove other columns option in removing
columns available when you select the Transformation arrow. This option removes all
columns that are not selected instead.

Step 3: Reverse rows

Finally, let’s reverse the order of rows as it appears on the table.

1. Notice that the Customer ID column is sorted in ascending order. To reverse the
order of all table rows, navigate to the Transform tab of the ribbon and select the
Reverse Rows transformation in the Table group of options.
2. The table has switched the order of its rows. They are now in reverse, descending
order. Note that this transformation only alters the appearance of the table rows.
It does not affect the information or sorting methods on the Report view
whatsoever.

Conclusion

Congratulations! You have successfully transformed the Customers table with Power
Query Editor. This allows you to perform several operations on a table before loading it
into your report. As a Data Analyst, mastering table transformations in Power Query will
aid you in preparing the data for effective data analysis.
Module 1:

Splitting column data

Scenario

In your role as a data analyst at Adventure Works, you encounter an unexpected


challenge when a dataset arrives but is formatted as tab-separated values (TSV) file. The
data appears compact and unstructured. Instead of asking to regenerate the data, you
opt for a more efficient approach by utilizing the column-splitting feature in Power
Query.

You import the TSV data into Power Query and employ the Split Column by Delimiter
function, choosing the tab character as the delimiter. This action effectively transforms
the compacted data into well-organized, individual columns. By leveraging the Column
Splitting feature of Power Query, you quickly rectify the format issue, saving time and
demonstrating the tool's versatility in handling and transforming data efficiently.

Splitting column data in Power Query

Splitting column data in Power Query is a powerful technique that allows data analysts
to divide a single column into multiple columns based on a specified delimiter or
pattern. Power Query provides a user-friendly interface to perform this operation,
making it easy to split and transform data during the data preparation stage. By splitting
columns, analysts can extract valuable information from concatenated or compacted
data, enabling them to perform detailed analysis, create meaningful visualizations, and
derive insights from their datasets. There are several types of column-splitting
techniques that can be employed in Power Query, each serving different purposes. Here
are three common types of columns splitting and scenarios where they can be applied.

Example: Split Column By Delimeter

For the scenario described above, let’s examine the data imported into Power Query.
To start splitting this data by Tab delimiter, select the Split Column dropdown and
select By Delimiter.

On the next window, select Tab in the Select or enter delimiter dropdown and select
OK.
It will take some time to transform the data. Once the process is finished, you will get
the clean data in the Power Query. Now you can Close and Apply the transform to load
the data and start creating.

Splitting techniques in Power Query

Now, let's explore the various splitting techniques available in Power Query.

Splitting by delimiter

Splitting a column by delimiter involves dividing the column into multiple parts based
on a specific character or string. This technique is useful when data is stored in a
concatenated format, such as First Name, Last Name or City | State | Country. By
splitting the column using the appropriate delimiter, like a comma or pipe symbol, you
can separate the values into distinct columns. This is one of the most common data-
splitting techniques used in data analysis. For example, in a customer dataset, you can
split the Full Name column into separate First Name and Last Name columns using a
blank space " " as a delimiter, enabling easy analysis and personalized communication.
Additionally, consider a scenario where you have received a sales dataset where the
Product Description column contains information in the format Country – Product
Category – Order Date. By splitting the column using the hyphen delimiter, you can
extract the country, product category, and order date into separate columns, allowing
for a detailed analysis of sales performance based on this data.

Splitting by fixed length

Splitting a column by fixed length involves dividing the column into multiple parts based
on a specified number of characters. This technique is useful when data is structured
with consistent character widths. For example, when dealing with a column containing
postal codes, where each postal code is of fixed length, you can split the column into
separate columns representing different components, such as country code, region
code, and local code. Imagine you have received a data file that contains Order Date
and Order ID mixed data like 10/15/2021123456, 12/01/2021789012,
11/05/2021345678, and so on. By inspecting the data you determine that the first 10
digits are the date, and the last 6 digits are the Order ID. In this case, you can use the
Power Query to split the data by fixed length into two separate columns, Order Date
and Order ID.

Splitting by positions

This is like splitting by fixed length, but particularly useful when there are more than two
parts in your data. For example, instead of Order Date and Order ID, if the data
contains Order Total too. Like 10/15/202112345622, where the first 10 digits are the
Order Date, the next 6 digits are the Order ID, and the rest is Order Total.
Splitting by lower to upper case or upper case to lower case

This function enables the splitting of a column where there is a transition from
lowercase to uppercase letters. Consider a scenario where you have a column
EmployeeNames in your dataset, where each entry combines the employee's first and
last names without a space, like AdioQuinn. In such cases, this splitting mechanism is
useful in order to split the names into two separate columns like First Name and Last
Name.

Splitting by digits to non-digit and vice versa

This method is particularly effective when handling data that combines alphabetic and
numeric elements. For instance, imagine receiving a file with product weights listed as
5kg, 10kg, or 700gm. You can use this splitting technique in Power Query to divide the
numerical weight values and their respective units into two distinct columns.

Conclusion

Split operations in Power Query are powerful tools for data manipulation, enabling you
to reorganize and cleanse your data more effectively. They are particularly useful in
scenarios where data is not optimally structured for analysis. By using these features,
you can format and structure the data, preparing it for further analysis without
additional manual effort or the need to regenerate it from various sources.
Module 1:

Activity: Sorting columns

Introduction

Sorting columns is an important step in data transformation within Microsoft Power


Query. It helps you to organize and analyze data more effectively to reveal trends and
patterns. Sorting also plays a key role in data cleaning, comparative analysis, and data
navigation. In this exercise, you are going to sort columns in Power Query.

Scenario

Working as a Data Analyst at Adventure Works is not an easy job. You have to deal with
lots of data every day. While preparing a report from quarterly sales data, your team
lead asked you to transform the data in such a way that anyone can have a look at the
data in Power Query and quickly understand how various regions and customer
locations are doing in sales. This can be done by sorting the data columns properly. For
example, you can sort the Region and Customer Location columns in ascending or
descending order and then the Order Total column in descending order.

Here is the initial state of data before applying any sorting:

Here is the result after applying the sorting:


Your task is to follow the instructions and sort the columns properly in Power Query.

Instructions

Step 1: Open the Power BI file in Power BI Desktop

• Download the Activity - Sort Columns.pbix file. Launch Power BI Desktop and
open the file.

Note: It's normal for no visuals to display at this stage; Ensure that the data is loaded
correctly by downloading the AdventureWorksSales.xlsx file and updating the data
source path from the ribbon Home > Data Source Settings.
Step 2: Open Power Query

• Select Transform data from the Home ribbon and select Transform data. This
action will lead you into the Power Query, where your data is prepared for
transformation.

Step 3: Close the Query Settings pane

• To increase the visible data area, close the Query Settings pane.
Step 4: Position key columns

• Scroll horizontally to view the following columns: Product Region, Customer


Location, and Order Total.

Step 5: Sort the Product Region column

1. Select the dropdown icon beside the Product Region column header. This opens a
new popup.

2. Select Sort descending from this dropdown menu.


Step 6: Sort the Customer Location column

• Select the dropdown icon beside the Customer Location column header and
select Sort ascending from this dropdown menu.

Step 7: Sort the Order Total column

• Select the dropdown icon beside the Order Total column header and select Sort
descending from this dropdown menu.
Step 8: Check everything

• Ensure all columns are sorted correctly: Product Region in descending,


Customer Location in ascending, and Order Total in descending order.

Step 9: Apply the transformation

• If everything appears correct, select Close and Apply on the Home ribbon to
apply the transformations to your data.
Conclusion

In this exercise, you have adeptly maneuvered through Power BI Desktop, effectively
organizing and sorting pivotal data columns. Arranging the Product Region, Customer
Location, and Order Total columns is crucial when applying these skills in practical
scenarios. By implementing column sorting, you've enhanced your knowledge of data
organization and cleansing, which is essential to deriving useful insights from your data.
Module 1:

Activity: Configure data loading for queries

Introduction

You’ve reviewed how to append and merge queries in Microsoft Power BI. In this activity,
you’ll apply your knowledge of the Power Query Editor to disable helper queries
automatically.

Scenario

Adventure Works recently suffered a data breach. As part of investigating the breach,
you must prepare a report displaying all files in a specific directory and their most
recent access time. Fortunately, Microsoft Power BI allows you to specify directories as
a data source, but you must disable the automatically created helper queries to achieve
the desired dataset.

Instructions

Step 1: Connect to the data source

1. Download the SalesOrders data folder and unzip it into a new directory.

Tip: You can right-click the zip folder and select Extract All.

2. Your directory should match the following image.

3. Create a new project in Power BI. In the Home tab, select Get Data.
4. In the Get Data window, select Folder and then select Connect.

5. The Folder window will open. Select the Browse button. When the file browser
opens, select the SalesOrders data folder you previously extracted from the zip
file.

6. Then select OK.


7. When the Folder inspection window opens, select the dropdown arrow next to
Combine and then select Combine & Transform Data.

8. In the Combine Files window, select the Sales table and then select OK.
9. The Power Query Editor opens with the data loaded.

Step 2: Disable the helper queries

Since the goal is to produce a dataset of filenames and access times for the specific
folder, you will need to disable the automatically created helper queries. The helper
queries are automatically created because Power BI assumes that the goal is to merge
the data from all of the files into a single dataset. While this is a common scenario, for
this scenario, this is not the desired outcome.

When the Power Query Editor first opens, it displays all of the datasets merged into a
single table.

1. First, remove all steps from the Applied Steps list except the Source step.
Note: The helper queries are no longer applied to the dataset. However, they are still
present in the Queries pane.

2. Right-click the Transform File from Group and select Delete Group. When
prompted, confirm the deletion.

3. Next, remove the unnecessary columns. The only columns required are the
Name and Date accessed columns.
4 The data is now ready to be loaded into Power BI. In the Home tab of the
ribbon menu, select Close & Apply.
5 Once the data is loaded, save the project.

Conclusion

Congratulations! You have successfully disabled helper queries and created the correct
dataset. Helper queries are a valuable utility for loading several files within a directory.
However, they are not always required. Knowing how to disable them and when it is
appropriate to do so is an important skill for a data analyst.
Module 1:

Activity: Find top performing products

Introduction

You've learned how to transform and load data using Power BI's Power Query. Now, you
must apply your knowledge of data transformation to find top-performing products. In
this activity, you’ll review the steps to manipulate and analyze data, focusing on using
the Group By feature in Power Query. The goal is to adeptly identify top-selling
products, leveraging the data transformation and loading techniques you've learned.

Adventure Works case study

Adventure Works must identify its top-selling products per country-region based on
total sales amounts from its Sales dataset. The dataset includes varied products sold
across different channels and regions. Your task is to help Adventure Works as follows:

• Apply Group By to the two columns, using Sales Amount as the aggregation,

• And to identify the top performing products per Category and Country-Region.

The objective is to provide clear insights into their highest revenue-generating products
per Country, enabling strategic decision-making.

Instructions

Step 1: Navigation to the task at hand

1. Download and launch the FindTopPerformingProducts Power BI file.

Note: Ensure that the data is loaded correctly by downloading the AdventureWorks
FactSales.xlsx file and updating the data source path from the ribbon Home > Data
Source Settings.

2. Select Transform data to navigate to the Power Query Editor.


3. Select the Sales table on the left sidebar and use the scroll bar on the bottom to
locate the last two columns: Category and Country-Region. Identify that the
Category and Country-Region columns do not contain unique values, so they
can be aggregated to provide product-specific insights.

Step 2: Group By transformation

1. You now need to apply the Group By transformation. This option can be found in
three places:

o On the Home tab in the Transform group. [Home, Transform Group, Group By]
o On the Transform tab in the Table group.

o On the shortcut menu, when you right-click to select columns.


2. Select Group By from any of the options above to access the Group By window.

3. Select the Advanced radio button to add multiple columns to the aggregation.
Ensure both Country-Region and Category are added to the grouping.
4. For the calculation, you must sum the total of the Order amount. Provide Total
amount as the new column name. Choose Sum as the operation, and Sales
Amount as the column.

5. Select Add Aggregation to add another calculation on the new table.


6. Each row of the Sales table represents an order. To calculate the total count of
orders for every product per region, name the second aggregation Order Count,
and assign the default Count Rows operation.

Tip: No Column is required for the Count Rows operation, as it counts all the table rows
before performing an aggregation.

7. To calculate the top-performing product, you require another aggregation,


performing the All Rows operation on the table. Add another aggregation, also
named All Rows.
8. Select OK to complete the Group By transformation.

Step 3: Extract the top-performer product information

1. When the Group By transformation is ready, your table will now contain the two
grouped columns, along with the three new aggregation columns.

2. The All Rows column, specifically, contains all table rows that contribute to the
aggregations. You can select any Table value on any row to preview the original
Sales Table rows that contribute to this aggregation.
3. To identify the best-performing product for each Category per Country-Region,
create a new column using the Add Column tab on the ribbon and select
Custom Column.

4. On the Custom Column dialog, name the new column Top performer product
and input the following code: Table.Max( Table.Group([All Rows], "Product",
{"Total Sales", each List.Sum([Sales Amount]) } ), "Total Sales"). Select OK to
create the new column.
5. The result of the formula creates a new column with Record values. These
record values are essentially a table with just one row. These records contain the
row with the maximum value for each Table value in the Products column.

6. With the new Top performer product column that contains Record values, you
can select the expand icon (represented by two outward-facing arrows) to the
right of the column title. Then, select the Product field, followed by OK.
7. The Top performing products per category and Country are now found in the
new column.

Conclusion

Congratulations! You have successfully identified the top-selling products in Adventure


Works' sales dataset using Power BI's Power Query. This allows you to transform
complex data into actionable business insights. By mastering data aggregation and
analysis techniques, you can drive strategic business decisions through informed data
interpretation.
Module 2:

Activity: Configure table and column properties

Introduction

In the previous lesson, you learned how to configure the table and column properties of
various tables of a data model. This activity is designed to empower you with hands-on
experience in configuring and formatting both table and column properties in Microsoft
Power BI Desktop. Specifically, in this activity, you will cover how to:

• Configure and format the table properties of your data model so that it is intuitive
for the collaborators

• Format column properties such as data type and category so that the analysis
provides accurate insights into the data

Scenario

Adventure Works management needs an accurate analysis of their sales data in a


visually appealing dashboard. The first step in every analysis is preparing the data,
where you need to perform formatting and configuration of the table and column
properties within your data model. This will help you to visualize data accurately with
properly formatted fields to avoid any confusion.

Instructions

Step 1: Download and open the Adventure Works.pbix Power BI project

Download the Adventure Works Power BI project file and save it to your computer. The
data model contains four data tables: Sales, Products, Sales

Step 2: Navigate to Model view and configure the table properties

Model view in Power BI provides many options to update and configure the table and
column properties.

1. Once you launch Power BI and open the Adventure Works project, navigate to
Model view to inspect the data model tables. The model contains four tables:
Sales, Products, Salesperson, and Region. Sales is the fact table, while others
are dimension tables.
2. Select the Sales table and expand the Properties pane of the Model view. The
Properties pane has two sections for formatting the table properties: General
and Advanced.
3. In the General section, you can format the following:

o Name and Synonyms: For this activity, you can keep the name and synonyms of
the table default.

o Description: The table description provides additional information or context


about the table. For example, you can write, The sales table contains sales
transactions from 2017 to 2020 for Adventure Works global operations. This
information will provide appropriate context for the report and dataset
collaborators without the need for them to dig deep into the data structure.
o Row label: A row label allows you to define which column or field best identifies
a single row in a table. This field is especially useful in dimension tables. For
example, in the Product table, you can define the Product Color field as the row
label. This enables the Power BI Q&A functionality to create more helpful visuals
when your report users ask specific questions.

o Key column: This column provides the unique values of the data table. In the
Sales table, the key column is SalesOrderNumber. Select this from the drop-
down field options.
o Whether the table is hidden or not (Is hidden): You can hide the table from the
Report view of Power BI Desktop by sliding the Is hidden toggle on. This feature
is useful in aggregated tables while using DirectQuery connectivity. You do not
need to configure this feature for this activity. Note: You can also rename the
table and add a description in the Query Editor of Power BI.

4. In the Advanced section of the Properties pane, you need to set the storage
mode of the table. Currently, there is only one storage mode available—Import.
Note: Power BI supports two more storage modes: DirectQuery and Dual
Storage.

Step 3: Configure the column properties

1. Select the Total Sales column from the Sales table. Under the General section,
you need to format the following properties:
o Name and Synonyms: You can leave these sections as default for this activity.
However, keep in mind that you can change them if needed by your organization
to meet specific business requirements.

o Description: In the description section, you can write additional details of the
measurement presented in the column. For example, in the current example,
type in Sales amounts in USD. This information specifies the currency.

o Note: In any activity related to configuring properties, you do not necessarily


need to configure all properties. This will depend on your dataset and what is
required for your analysis. This activity mentions the various properties that you
can configure, but not all will require configuration in the current context.

o Display folder: This is the utility feature where you can organize your measures
and columns into folders.

o Is hidden: The last property is whether you want to hide the column from the
Report view. This is useful if you want to hide some sensitive information from
report viewers.

2. In the Formatting section, you need to format the following column properties:

o Data type: You need to select an appropriate data type depending on the field.
For example, the Total Sales column contains sales amounts that should be in
decimal number format. If not selected, choose Decimal number from the
drop-down options.

o Format: By default, General is selected. You need to select Currency from the
drop-down. This formatting will display a $ sign before the sales amounts and is
easy to comprehend for the report users. A new field appears where you need to
specify the currency format. Select $ English (United States). This feature
allows you to display sales amounts in different currencies for overseas
operations.
o Percentage format: By turning this toggle feature to the on position, Power BI
displays the values as percentages. You do not need to configure this feature for
the current activity.

o Thousands separator: Turn this feature on in order for Power BI to display a


thousand operator in the sales amount.

o Decimal places: Auto is selected by default. Enter 2 to specify the decimal


places for your fields or measures.
3. Finally, in the Advanced section, you need to configure the following column
properties:

o Sort by column: This feature allows you to sort a field based on another column,
depending on your visualization requirements. For example, you can sort the
month name column either alphabetically or by month number. In this case, you
can leave the default selection.

o Data category: This formatting is important while working with location-based


data. For example, select the Country column from the Region table and then
select Country/Region as the data category. Power BI detects this field as a
country to accurately display the geographical boundaries on the map visual. A
globe map icon appears before the field name.

o Summarize by: This feature tells Power BI what arithmetic operation should be
applied during aggregation and visualization. Sum is selected by default. You can
keep this as is for the activity.
o Is nullable toggle: Turn this on only if your column or field contains null values.
You do not need to turn this on for the current activity.

4. Alternatively, you can also format the column properties from the Column tools
tab in Power BI. You can access this tab from the Data view of Power BI Desktop.
Conclusion

Formatting the tables of a data model and configuring their column properties are
essential components of data analysis and visualization in Power BI that you will be
assessed on in your Microsoft PL-300 exam. It also empowers you to seamlessly
collaborate with your team members and stakeholders during the analytical process.
Module 2:

Activity: Common date tables

Introduction

When working as a data analyst in Microsoft Power BI, creating a common date table
can be a valuable asset for your data analysis and visualization tasks. Date tables
enable you to filter, group, and analyze time-related data effectively. In this activity, you
will explore why a date table is important within your date model and how to create one.

Why date tables are important

Before revisiting the steps involved in creating a date table in a Power BI data model, it is
important to cover why having one is crucial in Power BI. A date table can help you in
performing time-intelligence calculations like year-to-date or month-to-date
aggregations. It can also be used to create custom time periods like fiscal years.

A common date table also helps in creating an effective data model. With a dedicated
date table, you can easily relate it to other tables of the data model that have date-
related information, which will improve the performance of your Power BI reports and
visualizations.

Pre-requisites for date table creation

Before you start creating a date table in Power BI, there are some prerequisites you
should have in place.

• Date column: Your data model must contain a date column with a Date/time
data type. This table will serve as the basis for building the date table.

• No blanks: A date column should not have any blank values, meaning every row
needs to have a valid date.

• Unique values: A date table should have unique values meaning each date
should appear only once in the date column.

• No missing dates: There should be no dates missing from a date column,


especially if you are working with continuous time periods.

Creating a date table

In Power BI, you can use Power BI’s Auto date/time function for simple time
intelligence calculations, but it is not suitable to perform complex DAX logic. You can
create a common date table within your data model using DAX, Power Query with M,
and even Pandas in Python and import the table to your model. For the current activity,
you will focus on creating a date table using DAX.
Instructions

Step 1: Download and launch the Power BI project Adventure Works.pbix

• Download the Adventure Works Power BI project file and save it to your
computer. The data model contains five data tables; Sales, Product, Region,
Reseller, and Salesperson. The model does not have a dedicated date table,
which you will create in this activity.

Step 2: Create a date dimension table using DAX

1. Access the Model tab in Power BI to view the data model. Note that there is no
date dimension table present in your model.

2. Navigate to the Home ribbon and select New table from the calculations group.
In the formula bar, input the following DAX code using the CALENDAR function
to create a table with a single column containing dates:

o Date = CALENDAR ( DATE( 2017, 1, 1 ), DATE ( 2021, 12, 31 ) ) Note: In the


CALENDAR function, you need to specify the start and end dates. The
Adventure Works sales data starts in 2017 and ends in 2020. The start date
must occur on or before the date column of the dataset. The end date must
be on or after the end date of the dataset.
3. Execute the code to generate a table with a single date column containing a list
of dates with time.

4. Alternatively, if you want to create a date range more specifically according to the
dataset, you can specify the start and end date taken from the OrderDate
column of the Sales table in the DAX script. The DAX script is as follows:

o Calendar = CALENDAR ( MINX( Sales, Sales[OrderDate] ), MAXX ( Sales,


Sales[OrderDate] ) ) Note: In the above formula, the use of MINX and MAXX
functions takes the minimum date value and the maximum date value from
the OrderDate column of the Sales table.
5. Next, you need to format and configure the table. Select the Date column and
navigate to the Column tools tab. Rename the column as Date and format the
column as Date data type.

6. Select the appropriate date format from the format drop-down list of options.

7. To populate the Date dimension table with related columns like year, month
number, month name, day of the week, and week number, select New column
from the Calculations group of the Column tools tab to expand the DAX formula
bar.
8. Enter the following DAX code in the formula bar, as demonstrated in the
screenshot below.

o Year = YEAR ( 'Date'[Date] )

9. Repeat the process by entering the following DAX code, one in each step.

o Month =FORMAT ( 'Date'[Date], "MMMM" )

o Month Number =MONTH ( 'Date'[Date] )

o Day of the Week =FORMAT ( WEEKDAY( 'Date'[Date] ), "dddd" )

o Week Number =WEEKNUM ( 'Date'[Date] ) Note: The date-related functions


in the above DAX formulas, like YEAR, MONTH, WEEKNUM, and WEEKDAY
extract the relevant information from the Date column of the table. You can
add more columns to your date table in a similar way as per your analytical
requirements.

Step 3: Mark the table as a date table in Power BI

1. Once you have created a date table, you need to mark the newly created date
dimension table as a date table. To do this, select the ellipses on the right side of
the date table and select Mark as date table from the drop-down list of options.
2. This opens a Mark as date table dialog box. Select the Date option from the
Date column drop-down menu. Once the dialog box displays the message
Validate successfully, select OK.

Now, DAX performs all its calculations based on the newly created date dimension
table.

Step 4: Establish a relationship between the Date table and the Fact table of the
data model

1. A Date table now appears in the Model view of Power BI.


2. You need to establish a relationship between the Date and the fact table in the
data model, which is the Sales table in the current model. The Date dimension
table is ready for analysis and reporting in your data model.

Step 5: Save the project

• Save the Power BI project with the new Date table as a new project. Make sure to
provide an appropriate name and path to the folder on your local computer.
Conclusion

Congratulations! You have successfully created a common date dimension table in a


data model using DAX. Now you can perform meaningful time intelligence calculations
and measures to group and slice and dice data according to business needs. As a
Power BI data modeler and analyst, mastering this skill will help you build efficient and
scalable data models.
Module 2:

Activity: Add a SUM aggregation measure

Introduction

You have a solid understanding of what measures are, how these can reveal the hidden
message in your data, and how you can create them using DAX. Although you can use a
rich library of DAX functions to compute measures required to fill the gaps in your data
analysis, in this activity, you will use the SUM DAX function to compute measures for
Adventure Works.

Scenario

Adventure Works' sales manager asks you to provide her with a quick overview of the
company's total profit. The dataset has a Sales Fact table containing Unit Price,
Quantity, and Cost columns. No information is available about the profit. With the
power of DAX, you can create measures to help the sales manager with her strategic
decisions.

Instructions

Step 1: Download the Adventure Works Sales file

• Download and save the Adventure Works Sales.pbix file to your computer. The
data model contains four related tables: Sales, Products, Region, and
Salesperson.

Note: The data model is configured for appropriate relationships and cross-filter
direction, and the dataset is cleaned and transformed to eliminate duplicate values.
Step 2: Create measures using DAX

1. To create a new measure in the Sales table, select the Sales table from the Data
pane on the right side of the Power BI Desktop interface. Navigate to the
Calculations group in the Data view and select New measure, which will
expand the formula bar.

2. Write the following DAX script in the formula bar and execute by pressing the
Enter key:

Total Sales = SUMX ( Sales, Sales[Unit Price] * Sales[Quantity] )

Note: As you learned previously:

• The SUMX function iterates over each row to calculate the total sales.

• Sales is the table name to be referenced.

• Unit Price and Quantity in square brackets are the columns that must be
multiplied to calculate the total sales.
3. You also need to calculate the Total Cost of the products to subtract it from the
Total Sales to calculate the profit. To compute the Total Cost, repeat the
process of creating a measure and write the following formula:

Total Cost = SUM ( Sales[Cost] )

Note: In this formula, you used SUM instead of SUMX because only one column is
referenced to compute the Total Cost.

4. Next, you can create a third measure to subtract the Total Cost from the Total
Sales to compute the company's total profit:
Total Profit = Sales[Total Sales] - Sales[Total Cost]

Step 3: Format measures

1. Select the Total Sales measure from the Sales table and navigate to the
Measure tools tab. You need to select Currency from the Format drop-down.

2. Enter 2 decimal places in the Formatting section.


3. Repeat the same process for the other two measures.

Step 4: Create a matrix to visualize the measure in context

1. Select the Matrix visual from the Visualizations pane and bring, for example, the
Country column from the Region table to the matrix.

2. Next, add the Total Sales and Total Profit measure to the matrix. Now the Total
Sales and Total Profit measures are computed by taking Country in the filter
context.

Note: You can visualize these measures similarly by product categories, products,
salespersons, and so on.
Step 5: Save the Power BI project

• Save the Power BI project. Make sure to provide an appropriate name and path to
your project.

Conclusion

Measures are dynamic calculations that summarize, aggregate, or analyze data as


needed. In this activity, you successfully created measures using SUM and SUMX
functions to help analyze the data that was originally not present in the data tables. The
Microsoft PL-300 exam tests your ability to create measures using DAX and integrate the
filter context within the measures.
Module 2:

Activity: Replacing implicit measures

Introduction

You have an Adventure Works dataset that contains a Sales fact table. When you drag
the Total Sales values to the report canvas for visualization, Microsoft Power BI
automatically summarizes the sales values and displays the total amount instead of
individual sales amounts. This is called an implicit measure. In this activity, you will
disable the summarization function of the sales implicit measure and create an explicit
measure by writing a DAX expression or using Power BI’s quick measures feature.

Implicit measures and aggregation in Power BI

You may recall that, in Power BI, an implicit measure is indicated by a sigma (sum) sign
before the column name, and this icon is visible before every numeric column. Power BI
sets all numeric columns automatically to summarizable, meaning whenever you
create visualizations from these columns, Power BI displays the aggregation instead of
individual values. You can change the aggregation type of implicit measures in the
visuals or disable the aggregation. The steps that follow will guide you through turning
off an implicit measure and replacing it by implementing an explicit measure.

Instructions

Step 1: Download and save the Adventure Works Sales.xlsx file. Import the Excel file
into Power BI
Step 2: Create a table/matrix visualization

1. To check how implicit measures work, select a Table visual from the
Visualizations pane and drag the Total Sales field from the Sales table to the
Table visual.

A single aggregated value is displayed because Power BI auto-aggregates the numeric


column.

2. Next, you need to create a Table visual to display the sales values for each
month of the year. Drag the Year, Month, and Total Sales columns from the
Sales table to the matrix. Power BI displays the aggregation of sales values by
taking Year and Month as filter context.

3. Now, you need to disable the aggregation of the implicit measure. Select the
small drop-down or expand arrow beside Total Sales from the Columns well of
the Table visual.

4. Select Don’t summarize from the drop-down menu that appears, displaying all
the available aggregation options.
5. Power BI now displays the individual sales values. Repeat the same process for
the second table displaying monthly sales amounts.

Step 3: Create explicit measures

You can create explicit measures by utilizing the Quick measure functionality of Power
BI. However, for this exercise, you need to write a DAX script to define the total sales.

1. You can create a Sales measure using DAX in two ways. First, by using the SUM
function, which aggregates the values from the Total Sales column as:

Sales = SUM ( Sales[Total Sales] )


2. The second way is by using the SUMX function that will multiply the Unit Price
column with the Quantity column and iterate each row of the entire table.

Revenue = SUMX ( Sales, Sales[Quantity] * Sales[Unit Price] )

Step 4: Add the newly created explicit measures to the table visuals

1. You need to replace the Total Sales column with the explicit measures you
created using DAX in the existing tables. The Sales and Revenue measures now
provide the aggregated values by taking any filter context into account, which, in
this case, is Year and Month. Note: There is no difference in values between the
two measures computed using different DAX formulas.

2. Save all changes to your project. You can create similar measures using other
numeric columns in the dataset, like quantity.

Conclusion

Although there are no differences in the performance of implicit and explicit measures,
explicit measures provide a more flexible approach because you can define a custom
logic in DAX expressions.
Module 2:

Activity: Create a semi-additive measure

Introduction

Semi-additive measures can be aggregated across some dimensions but not for others.
Time is one of the main dimensions. Inventory and account balance are classic
examples of semi-additive measures. This activity will equip you with the hands-on
skills for handling semi-additive measures like inventory on hand.

Scenario

The product manager at Adventure Works needs up-to-date information about the
product stock on hand to make important decisions about new product acquisition and
manufacturing. Creating measures using a simple SUM function will not solve the
problem. You need to use DAX functions that can handle semi-additive measures to
provide accurate inventory on-hand information to the product team. Let’s explore how
you can do this in DAX and Microsoft Power BI.

Instructions

Step 1: Download the Excel file.

• Download and save the Adventure Works Inventory.xlsx file. Import the Excel file
into Power Bi. The data model contains only a single table called Inventory. The
table contains information like StockLevel and Date required to create
measures.
Step 2: Create a measure using SUM and visualize data in table visual.

1. Create a DAX measure using the SUM function to compute the total stock level
from the dataset. You need to write the following DAX script:

Product Inventory = SUM ( 'Inventory'[StockLevel] )

Note: The SUM function is simply summing up the values from the StockLevel column
of the Inventory table.

2. Create a Table visual to visualize the results of the Product Inventory measure.
The values represent the sum of all the products in stock at a given time and do
not reflect the stock on hand.
Step 3: Create measures using the LASTDATE function.

1. To gain information about the current stock on hand at the end of each month,
you need to write a DAX expression using the LASTDATE function inside the
CALCULATE function:

Closing Balance = CALCULATE ( 'Inventory '[Product Inventory], LASTDATE ( '


Inventory '[Date].[Date] ) )

In the above DAX expression, LASTDATE takes the last date of the month to calculate
the stock on hand by using the Date as a parameter.
2. You can bring the Closing Balance measure to the matrix to visualize the results.
Note that March and May have blank Closing Balance values in the matrix
because the DAX expression uses the last date, and if that date is a weekend or
holiday, it returns as blank.

3. To overcome this issue, you need to use the following LASTNONBLANK function

In the above expression, the LASTNONBLANK function uses the value for the last day of
the month that is non-blank, thereby ignoring any holiday or weekend.
4. Next, drag the Closing Balance(Non-Blank Measure) to the matrix to visualize
the results. Now, the matrix represents the accurate value for stock on hand for
each month-end.

Step 4: Create measures to display the opening balance.

1. You can compute each month's opening balance similarly by using FIRSTDATE
instead of LASTDATE. The DAX code for the measure is:
2. Displaying the Opening Balance measure in the matrix raises the same issue
because of non-working data at the start of the month. You can solve this by
using the FIRSTNONBLANK function as follows:
The results of the measure are displayed in the matrix:

3. Apply all changes to your Power BI project.


Conclusion

You have successfully managed the semi-additive measure of inventory on hand and
provided the most accurate information about the number of in-stock products in any
given warehouse. This information empowers users to make strategic decisions.
Module 2:

Path DAX functions

Introduction

As a data analyst in a retail store, you're surrounded by a wealth of data from sales,
customer interactions, and product movements. You deal with complex data
structures, like product categories and employee roles, all of which form a big puzzle.
Understanding these data hierarchies is key to fully utilizing your data, linking sales to
customers and team operations. In this process, you've started using Path DAX
functions in Power BI.

This reading aims to assist you in understanding the workings and applications of Path
DAX functions in Power BI. By the end of this reading, you’ll understand the specific
roles and uses of each Path DAX function–PATH, PATHCONTAINS, PATHITEM,
PATHITEMREVERSE, and PATHLENGTH.

Path DAX functions

PATH function

The PATH function in Power BI helps create hierarchical structures from data, turning
complex relationships into clear paths. This function is important for analyzing
hierarchical data and making it easier to understand connections between different
data points. It's particularly useful in visualizing structures like organizational charts or
product hierarchies, adding clarity to Power BI reports. For example, the PATH function
can show the reporting structure in a company by turning employee and manager data
into a string that outlines the chain of command, helping in understanding company
dynamics and workforce planning.

EmployeePath = PATH(Employees[EmployeeID], Employees[ManagerID])


PATHCONTAINS function

PATHCONTAINS in Power BI is used to check if certain items are in a hierarchy, helping


to filter and segment data accurately for precise analyses and reports. It's useful when
you need to focus on specific parts of a larger group, like finding certain products in a
category or employees in a department. For example, you can use PATHCONTAINS to
determine if Organic products are in the Food & Beverages category, aiding in targeted
product analysis or marketing.

IsManagedBy5 = PATHCONTAINS([EmployeePath], "5")


PATHITEM function

PATHITEM in Power BI is important for pulling out specific layers of hierarchical data,
enabling detailed analysis. It's great for situations where you need to focus on specific
details, like examining a particular product line in a category or understanding a team
member's role in an organization. PATHITEM increases the accuracy of your Power BI
analyses and reports. For instance, if you're exploring a company's divisions, PATHITEM
can identify the Marketing department within the Sales and Marketing division for
more targeted analysis and reporting.

DirectManagerID = PATHITEM([EmployeePath], 2)
PATHITEM reverse

PATHITEMREVERSE in Power BI is used for tracing data paths backwards. It's useful for
understanding how individual elements fit into the bigger picture, such as how a
product fits into a category or a role in an organization. This function helps provide a
broader context in various scenarios, enhancing Power BI reports. For example, with a
specific laptop model, PATHITEMREVERSE can trace back to its broader category, like
Electronics, showing how specific products are categorized.

TopLevelManagerID = PATHITEMREVERSE([EmployeePath], 1)

PATHLENGTH function

PATHLENGTH in Power BI measures the depth of hierarchical structures, showing the


breadth and complexity of things like product ranges or organizational charts. It helps to
understand how extensive a hierarchy is. For instance, you can use it to find out how
many levels there are in product categories. A high PATHLENGTH in a category like
Home Appliances suggests a large variety of products, which is useful for inventory and
marketing planning.

HierarchyDepth = PATHLENGTH([EmployeePath])
Conclusion

As a data analyst, remember that the real value of Path DAX functions goes beyond just
organizing data and creating reports. They help you to discover insights and strategies
that allow you to make an impact. In the world of retail, where details matter, these
functions give you the ability to see and understand the bigger picture, one data point at
a time.
Module 2:

Activity: Adding a calculated table

Introduction

You should now have a good understanding of how to use DAX formulas and functions
in Microsoft Power BI to create calculated tables and columns. In this exercise, you will
apply your knowledge of DAX to add a calculated table to an existing dataset.

Scenario

Adventure Works' CEO needs a sales summary table containing annual sales amounts
and quantities sold for each country. The original sales table is a huge table with
millions of rows representing individual sales transactions. Using the DAX table
functions you must create a calculated table displaying the requested information only.

Instructions

Step 1: Download the Adventure Works sales file

• Download the Adventure Works Data.xlsx file and save it to your local computer.
You need to load the Excel data to the Power BI data model. The data model
contains four tables: Sales, Products, Salesperson, and Region. Power BI
automatically establishes the relationships between the fact and the dimension
tables.

Note: The dimension tables are related to the fact table via one-to-many relationships
and a single cross-filter direction.
Step 2: Clone the sales table

1. Adventure Works wants to perform analytical works on the Sales table but keep
the original Sales table unaltered. You need to create an exact copy of the Sales
table. To do this, select New table from the Home ribbon.

2. Write the following DAX code to clone the Sales table.

3. Execute the code to add a new table named Sales (Cloned) to the model.
Step 3: Create a calculated table using DAX

1. As per Adventure Works requirements, you need to create a table containing the
annual sales summary for countries. You can use the DAX function SUMMARIZE
table. You need to include four columns in the summary table: Year, Country,
Sales Amount, and Quantity sold.

2. Select New table from the Home ribbon of the Data view or Model view of
Power BI and write the following DAX expression.
In the above expression:

• Sales is the original sales table of the data model.

• Sales[OrderDate].[Year] and Region[Country] are the group by columns,


meaning the data is grouped by the country and the year.

• Sales Amount (USD) is the name of the new column to be added to the table,
followed by the expression SUM ( Sales[Total Sales] ), which is summing the
Total Sales column from the original Sales table.

• Unit Sold is the name of second column to be added to the new table and is
followed by the expression SUM ( Sales[Quantity] ) that is aggregating the
Quantity column of the original Sales table.

3. Execute the code and note that a new table is added to the data model.
4. Thinking of a different way to compute the same calculated table? Can you use
pre-calculated measures instead of expressions? Yes, you can define measures
for Sales and Units Sold for the Sales table.

Use them in the expression to calculate the Annual Sales Summary table as:

Note: In the above DAX script, both SUM expressions are replaced by pre-defined
measures Sales and Units Sold, respectively. This DAX code produces the same
results.
5. Note that the Sales Amount (USD) column displays the sales amount, but it
looks unformatted. Navigate to the Column tools and format the column as
Currency with 2 decimal places.
Step 4: Save your project

• Apply all changes to your project, and make sure you provide an appropriate
name and path so that you can access the project for later use.

Conclusion

With these steps you have created a calculated table to display the Annual sales
summary with user-defined columns in the table, as per analytical requirements. You
can leverage DAX power to create calculated tables within your data model to fulfill
business needs. Remember that when using DAX expressions, you must ensure they are
correctly formatted and that the column names match the actual column names in your
data.
Module 2:

Activity: Creating a report hierarchy

Introduction

You have gained a solid understanding of how to create a data hierarchy and how it
helps in navigating to the granular details of data through the drill-down functionality. In
this activity, you will learn how to create a hierarchical structure with various levels
depending on the fields to help your audience dig deeper into the information to make
informed decisions.

Scenario

The Adventure Works sales managers need a report that displays the details of the
location of sales transactions. The visualization should present the data in a way that
the manager can easily navigate from country to individual postal code to track
individual sales. On the other hand, they also want to get sales information based on
date dimensions, from an annual overview to daily sales values. You need to visualize
the sales data in both a geographical and date hierarchy.

Instructions

Step 1: Download the Power BI file

1. Download the Adventure Works Sales - Data hierachy.xlsx file and save it to your
local computer.

2. You then need to load the Excel file to the Microsoft Power BI data model.

Note: In most cases, Power BI automatically establishes the relationships between the
data tables, but you need to make sure the relationships are accurate. The data model
contains two tables; FactInternetSales and Geography. The Geography dimension
table is related to the Fact table via a one-to-many relationship and a single cross-filter
direction.
Step 2: Visualize the sales data with a geographical hierarchy

You need to create a geographical hierarchy to present the sales amount for each
location. You can use a map visual, such as Filled maps or Azure maps, but, for this
activity, you can use a bar or column chart. You can create the hierarchy by dragging and
dropping fields into the chart axes, or using the context menu.
Method 1: Create a geographical hierarchy by dragging fields

1. Select the Clustered bar chart from the Visualizations pane

2. Bring the Sales Amount field to the X-axis of the chart.

3. Create a geographic hierarchy by bringing the Country, State/Province, and City


fields from the Geography table to the Y-axis of the visual in the correct order.
Remember to format the visual’s font, color, and style.
2. Select Create hierarchy from the drop-down menu. This action will create a
Country Hierarchy.

3. Next, select the StateProvinceName field from the Data pane, select Add to
hierarchy from the drop-down list, and select an appropriate hierarchy where
you want to add the field. In the current exercise, you only have one hierarchy—
Country.
4. Select the Country Hierarchy, and the field will be added as the second level of
the hierarchy. Repeat the process for City. A Country Hierarchy has been
created, and you only need to bring the entire hierarchy field to the visual.

Step 3: Drill-down into the data

1. On the top right side of the visual are arrows used for the drill-down functionality.
To turn the drill mode on, select the second down arrow.
2. You can now hover with your cursor over any data point, and a drill down and a
drill up icon appear in the tooltip. For example, hover with the cursor over the
United States and select Drill down. The visual automatically displays the sales
values for the US states.

3. From here, you go further down the hierarchy. For example, hover with the cursor
over Texas and select Drill down to navigate to individual location sales within
Texas.
Step 4: Visualize data with a date hierarchy

Next, you need to create a date hierarchy. Power BI automatically generates a Date
Hierarchy when you load a dataset containing a Date column.

1. In the current example, expand the OrderDate column of the FactInternetSales


table from the Data pane. Under the OrderDate, expand the Date Hierarchy to
view the levels of the hierarchy. In your visualization, you can use any number of
levels from the Date Hierarchy.
2. You can create an individual visualization to display data based on the Date
Hierarchy or create a slicer with a Date Hierarchy. For this exercise, you need to
create a slicer with a Date Hierarchy. Select the Slicer visual from the
Visualizations pane and bring the entire date hierarchy to the visual field.

3. Select Vertical list from the Slicer Style drop-down. Note: There is a small
arrow icon before each year in the slicer.
4. Expand the arrow to view the next level of the hierarchy, which is Quarter 1,
expand Quarter 1 to view the next level, which is months, and so on.

5. You have now created a Date Hierarchy slicer where you can interactively
visualize your data based on both the geographical and date hierarchy.
Step 5: Save your project

• Make sure you apply all changes to your Power BI project and provide an
appropriate path so you can retrieve the file for later use.

Conclusion

Date hierarchy is a valuable feature of Power BI that lets your report users navigate to a
deeper level of information and enhance user engagement by introducing interactivity.
With the steps outlined in the exercise, you have created a visual with a geographic
hierarchy and a slicer with a date hierarchy. To excel as a Power BI developer and report
designer, you should explore further to investigate what other hierarchical structures are
available in Power BI.
Module 2:

Activity: Add an Index Column

Introduction

Just like many interesting features in Microsoft Power BI, index columns can help in
transforming data in Power Query. You can identify each data row with a unique number,
transform unstructured data, or utilize this index column for writing efficient DAX
queries.

In this activity, you will implement this feature in an unstructured dataset and convert it
into a structured one.

Scenario

Imagine you have received an unstructured dataset where all the data, including the
column headers, is contained within the same column one after another. Your team
lead has requested that you transform this data into a structured format suitable for
creating data reports. Instead of asking to regenerate this data, you will employ the
powerful index column feature in Power Query to transform it into a usable dataset.

Here is a view of the raw dataset before transformation:

And here is the dataset after the transformation using an indexed column.
Your task is to follow the instructions and correctly transform the data.

Instructions

Step 1: Open the Power BI file in Power BI Desktop

• Launch Power BI Desktop and open the file

It's normal to see no visuals at this stage; the data should be loaded correctly.
Step 2: Open Power Query

• Select the Transform data dropdown from the Home ribbon and select
Transform data. This action will lead you into the Power Query, where your data
is prepared for transformation.

Step 3: Close the Query Settings pane

• To increase the visible data area, close the Query Settings pane.
Step 4: Add an Index column

• Select the Index column dropdown on the Add Column ribbon and select From
0. This will add a new index column in your data model with sequential numbers
starting from 0.

Step 5: Check the new indexed column

• A new indexed column appears in your data model with sequential numbers
starting from 0.
Step 6: Add a Modulo column

1. You will now apply some transformation in this model to convert everything to a
structured data model. For this transformation, you need to add a new Modulo
column.

2. Select the Standard dropdown in the Add Column ribbon and then select
Modulo.

Step 7: Input number to calculate the remainder

1. In the new popup, input 3 because we have three column titles in our
unstructured data, Month, Order Quantity and Order Total.

2. Select OK.
Step 8: Check the new Modulo column

• A new column with remainders appears in your dataset which looks like the
following picture.

Step 9: Add another Divide column

1. To transform the dataset by pivoting, you need another helper column to indicate
the position of each row.

2. Select the Index column, then select the Standard dropdown in the Add
Column ribbon, select Divide (integer) and input 3.
Step 10: Check the new column

• A new column appears in the data model which looks like the picture below

Step 11: Remove the indexed column

You don’t need the indexed column anymore since you have the necessary data for
transformation, so let’s remove that column.

• Right-click on the indexed column header and select Remove.


Step 12: Pivot the data model

Now you can start your pivoting process.

• Select the Module column and then select the Pivot column from the Transform
ribbon.

Step 13: Pivot column settings

1. In the new popup, select Data in the Values Column dropdown, and select
Don’t Aggregate in the Aggregate Value Function dropdown inside the
Advanced options section.
2. Select OK.

Step 14: Check the pivot table

• Your data model will be transformed into the pivot table which looks like the
image below.

Step 15: Remove the unnecessary columns

You don’t need the Integer-Division column anymore.


• Right-click on that column header and select Remove. This will remove the
Integer-Division column from your data model.

Step 16: Check the data model

• Now your data model looks clean and almost ready. It now looks like the picture
below
Step 17: Promote the correct column headers

1. Notice that column headers in this data model show 0, 1, 2. You need to remove
those column headers and set Month, Order Quantity and Order Total as the
correct column headers.

2. Select the Table icon and select Use First Row as Headers.

Step 18: Check the final model

• When the first row is set as column headers, the data model will look like the
image below:
Step 19: Apply the transformation

Now that everything looks as expected and the data has been transformed using an
indexed column, it’s time to apply the transformation.

• Select Close and Apply from the Home ribbon.


Conclusion

The Indexed column feature in Power Query is a valuable tool for transforming data into
the desired format, making it suitable for generating informative data reports.
Additionally, this feature helps to write efficient DAX queries. Understanding how to
implement this feature is essential for becoming a skilled data analyst.
Module 2:

Activity: Optimal data types and reducing data

Introduction

The performance of your data model is pivotal to the efficiency of your reports and
dashboards. Two key strategies for enhancing your data model performance involve
thoughtful changes to the data types and judicious removal of unnecessary rows and
columns. In this activity, you will optimize an Adventure Works dataset by changing data
types, removing rows and columns, and optimizing relationships where necessary.

Scenario

Adventure Works has a vast network of stores, an extensive product catalog, and
thousands of sales transactions. As the company endeavors to harness the power of
data analytics, the need for model performance optimization becomes evident. As the
volume of data grows, the company is facing sluggish reporting performance, which
they need you to diagnose and fix.

Instructions

Step 1: Download the Adventure Works Sales file

• Download the Adventure Works Sales.xlsx file to your computer and load it to
Power BI Desktop. The dataset contains five tables in the data model: Sales,
Products, Region, Salesperson, and Date.
Step 2: Observe data and remove duplicates

1. Once you load the data, the first step is to inspect the data.

2. Navigate to the Data view and observe the records.

3. From the Data view, select the Sales table from the Data pane to display the
details of sales data. Here you can observe the records of individual columns.
This will give you an idea of the nature of the values and what the data types are.
Note: You can select other tables one by one from the Data pane to observe the
records in all data model tables.
4. You also need to observe the key column of Sales for any duplicate records that
will hinder accurate data analysis. Select SalesOrderNumber column. The total
number of rows and distinct values are displayed at the bottom right corner of
the interface. There are 57,851 rows but only 3,616 distinct values (order
numbers). You need to remove the duplicates because order numbers should
not be repeated.

5. Select Transform data to open the Power Query Editor.


6. From the Editor, select the Sales table from the left-side Queries pane. Right-
click the SalesOrderNumber and select Remove Duplicates from the context
menu.

7. Select Close & Apply to go back to the Power BI Desktop interface.

Step 3: Optimize the relationships

1. Navigate to the Model view of Power BI Desktop, where the graphical


representation of the data tables and the relationships between them is
displayed. Observe that there is no relationship between the Date table and the
Sales fact table. This means you cannot create any visualizations based on the
Date table.
2. Establish a relationship between the Sales and Date table. You can do this either
by dragging the Date column from the Date table to the OrderDate column of
the Sales table, or you can select Manage relationships from the Home ribbon
and create the relationship manually.

Step 4: Inspect and change data types

Appropriate data type is key to accurate and visually appealing visualizations. You can
change or update the data type of individual columns either from the Data view or the
Model view of Power BI Desktop. For the current activity, you can do this from the Data
view.
1. Select the Sales table from the Data pane and select any column that takes you
to the Column tools. Ensure the data types for the following columns are:

o OrderDate: Date (Note: you need to select the date format)

o Unit Price: Currency with two decimal places

o Cost: Currency with two decimal places

o Total Sales: Currency with two decimal places

2. Next, select the Region table from the Data pane and make sure the Data
category of the following columns is set to:

o Continent for Group


o Country for Country

Step 5: Save your project

Your data model is now optimized for better performance by removing duplicates,
updating the data types, and managing relationships. In the context of real-life data
applications where you’ll have bigger and more complex datasets, optimization is the
key to efficient performance.
• You need to save your Power BI project to your local machine or cloud, whichever
you prefer.

Conclusion

Optimizing a data model's performance is a strategic endeavor that involves fine-tuning


both the structure and content of your dataset. By meticulously selecting appropriate
data types, managing the relationship between data model tables, and eliminating
unnecessary columns and rows, you can create efficient and accurate reports and
dashboards in the Power BI ecosystem.
Module 3:

Activity: Format and configure visualizations

Introduction

By now, you should be familiar with the methodology of selecting the appropriate
visualization to satisfy a business need and all the available formatting and
configuration options Microsoft Power BI provides. In this activity, you must apply your
knowledge of visualizing and analyzing data to format and configure visualizations.

Scenario

Lucas completed his exploration of Power BI's formatting capabilities. He's now ready to
refine the Sales Categorical Analysis report, aiming to boost its visual appeal and clarity
for users. His next step is implementing these ideas, transforming data into compelling
visuals that speak clearly to the audience.

Instructions

Step 1: Report Setup

1. Download the Sales Categorical Analysis report and launch it in Power BI


Desktop.

2. Navigate to the View button of the ribbon and select Selection to view and
identify the components of the report. The four visualizations are:

3. Select the X button to the right of the Selection pane to close it.
Step 2: Exact color formatting

Your next task is to adjust the Text box title to have the same green color as the line
divider (Shape). To be precise with color formatting, you need to use the color's
hexadecimal code (hex code). Therefore, to ensure two separate items have matching
colors, you must provide the visualization with the hex code of the specified color.

1. To identify the hex code of the divider line, select it, navigate to the Format pane,
and select Style, followed by Border. The color of the line is displayed here.

2. Select Color, and then More colors.


3. You can find the hex code and RGB code of the color in this window. Select
Ctrl+C to copy the #437A2C code.

4. Now, select the Text box visualization.

Tip: If you have trouble selecting a specific item due to overlapping visualizations, you
can always enable the Selection pane and select it from there.
5. The Text box visualization displays its settings on a hovering toolbar. Select the
title text and then the down arrow to the right of the A symbol on the toolbar to
adjust its color.

6. The same palette window displays. Select More colors to view the color code
window.
7. Color code #000000 appears, which is the hex code for the color black. Press
Ctrl+V to paste the #437A2C code in the Hex field to make the selected text the
correct shade of green.

8. Press the Esc button or click anywhere on the canvas to exit the formatting
windows and view the result. The title now has the same green color as the line
shape.
Tip: When formatting visualizations, having the maximum screen size possible to
determine the best result is crucial. So, it is advisable to close all unnecessary panes.
You can hit the top arrow on the bottom right of the top ribbon to hide it and the double
right arrows on the Data pane as you won't need these during formatting.

Step 3: Formatting Sales Amount by Color (visual settings)

Table charts are used to view multiple data fields in a tabular format. The existing table
visual contains only a single attribute field with a single metric. As a result, you can use
a more suitable visualization. An attribute field split into its values with a corresponding
metric is a categorical analysis. As you already know, column and pie charts are the
optimal visualizations for this type of analysis. In this step, you'll replace the table
visualization with a pie chart and format the new chart.

1. Since you already have a column chart and there are not many category
attributes, a pie chart is a more appropriate visualization to add variety to the
report. To change the Table visualization to a pie chart, select it and select the
Pie chart icon in the Visualizations pane.

2. The Table chart has now changed to a Pie chart.


3. One of the most common formatting practices in pie charts is integrating the
legend with the detail labels, making it easier to read. Select the Pie chart and
navigate to the Format visual pane to do this. Next, navigate to the Visual
settings and locate Detail labels.

4. In the Label contents field, select Category, percent of total to include just
these two on the data label.

5. Expand Values to adjust the font. Choose a font size of 14.


6. The legend is no longer needed, so you can scroll up to locate the Legend
options and toggle it Off.

Step 4: Formatting Sales Amount by Color (general settings)

1. Select the Pie chart and navigate to the General settings. The General settings
are shared among all visualizations.

2. Expand the Title options and adjust the Font size to 20.

3. Next, select the middle icon of the Horizontal alignment options to center the
title of the visual.
4. Scroll down to the Divider settings and toggle it to On.

5. Select Solid from the Style field.

Step 5: Formatting Sales Amount by Category

One of the tasks given to Lucas is to modify the scale of the Y-axis, as the difference
between the Sales Amount of the categories results in some columns not standing out.
To alter the axis scale, you can change it to a logarithmic scale instead of arithmetic.

1. To do so, navigate to the Format visual pane and then to the Visual tab, as this is
a column-chart-specific setting. Now, expand the Y-axis settings.
2. In the Range section, toggle Logarithmic scale to On to view the results.

3. Finally, let's change the visualization's title to resemble the title in the Pie chart. To do
this, you can follow the same steps as you did for the pie chart. But, because the
General settings of the visualizations are shared, there is an easier way to do so.

4. Select the Pie chart and then the Format Painter icon to the left of the Home tab on
the ribbon.
4. This will modify your cursor in a brush, applying the formatting options of the
selected visual to the next visualization you select. Select the Column chart to
apply the same formatting options. Observe how it immediately copies all the
general options of the Pie chart to the Column chart.

Conclusion

Congratulations! You have successfully formatted and configured a report's


visualizations. As a Power BI analyst, mastering the handling of formatting options will
help you build compelling reports.
Module 3:

Activity: Conditional formatting

Introduction

Previously, you’ve navigated through all main formatting and configuration options in
Microsoft Power BI. In this activity, you will apply your knowledge of conditional
formatting to enhance your visualizations’ appearance further.

Case study

Lucas has completed formatting the visualizations of the report. He is now ready to
apply conditional formatting to enhance their dynamic format.

Instructions

Step 1: Gradient conditional formatting

1. Open the Sales Categorical Analysis report configured in the previous activity.

Note: As you discovered in previous lessons, conditional formatting in Power BI does


not only happen in table and matrix visualizations. You can now apply it to various
aspects of visuals, like their columns or slice colors.

2. To apply conditional formatting to the column chart visualization, select it and


navigate to the Format visual options of the Visualizations pane.

3. Locate the Columns option and expand it.


4. To the right of the Default field, a function symbol displays, indicating that you can
conditionally format the column color based on specified criteria.

5. Select it to navigate to the conditional formatting window.

6. In this window, three main Format style options appear. For this example, select the
Gradient format style. In this formatting style, a field is chosen to color the columns
based on their values.
7. Select Sales Amount by searching for it and select Sum in the Summarization field,
as you’re basing the column color on the exact field being analyzed.

8. Select the Add a middle color box to add a third color in the gradient format.

9. Select OK to apply the conditional formatting results.


10. The columns are now colored based on the sum of sales amount value for each one.

Step 2: Field value conditional formatting

Applying a color attribute in a visualization is always tricky. Lucas considers that if the
pie chart’s slices’ colors are representing the product color being analyzed, it will be
much easier for the users to understand the context of the visualization. Luckily, you
can easily accomplish this with conditional formatting.

1. To accomplish this result, you need to store the hex codes of the product colors
in the dataset. For this reason, a ColorHexCode column has been created in the
Product table. Navigate to the Table view and scroll to the last column in the
Product table to view it.

2. This DAX code connects each product color of the Product table to its
respective hex code, stored in text format. This way, any coloring of the slices can
be configured accurately and modified easily in case of future changes.

3. Navigate to the Report view and select the Pie chart to adjust the field value
conditional formatting.
4. Select the Format visual options in the Visualizations pane to apply
conditional formatting to the Pie chart visualization.

5. Locate the Slices option and expand it. Unfortunately, conditional formatting
is unavailable for a Pie chart, so another visualization needs to be selected.
Note: This step demonstrates the importance of navigating through a
visualization’s available settings before choosing the appropriate visualization.
Lucas had to make a last-minute alteration to the visualization here.

6. Select the Treemap visualization icon to transform the Pie chart into a
Treemap.

7. Navigate to its Colors settings. The Advanced controls symbol gives you the
option to apply conditional formatting.
8. Select it to open the conditional formatting window. Select Field value as the
Format style and locate the ColorHexCode column to be used.

9. Select OK to view the results.

10. Note that by selecting the Conditional formatting symbol, represented by a


function symbol again, you can modify the formatting criteria. You can also
select the Eraser symbol to its right to remove the conditional formatting.
11. The conditional formatting for both visuals has now been adjusted.

Tip: Even though pie charts do not have conditional formatting available for their slices,
the Treemap Conditional formatting has successfully assigned each category its
respective color. That means that if you set the visualization back to a Pie chart, the
slices will keep their respective color! Be careful, as this is no longer dynamically
adjusted, so any new category slices won’t have the ColorHexCode color automatically
assigned to them, and the steps above will have to be re-applied.
Conclusion

Congratulations! You have successfully applied conditional formatting to your


visualizations. This allows you to configure your visualizations’ appearance further with
dynamic criteria, making them even more compelling to end users.
Module 3:

Activity: Configure the report page

Introduction

Previously, you've navigated through all main formatting and configuration options in
Microsoft Power BI. In this activity, you must apply your knowledge of report page
settings, modifying the appearance and configuration of the report's page.

Case study

Lucas has crafted a Sales Categorical Analysis report that provides valuable insights
into sales performance by product category and color. His next task is to upgrade the
report's appearance and functionality. He needs to adjust the report's page settings,
fine-tune the canvas, apply a background, and streamline the filter pane and filter
cards.

Instructions

Step 1: Report launch and set-up

1. Download and launch the Sales Categorical Analysis report in Power BI Desktop.

2. Click on any empty space in the canvas.

3. Locate the Format Report page button and select it.

Tip: Although both are accessible from the same button, you can differentiate between
the Report page settings and Visualizations settings button by the icon's background.
While the Visualizations settings display a brush on top of a chart, the Report page
settings display a brush on top of a blank page. You can shift between selecting a
visualization and a blank canvas space to view their differences.

4. Navigate to the Format page settings, where you can configure the general
settings of the report page if you haven't already.

Step 2: Page information and Canvas Settings

1. For the first configurations, expand the Page information settings.


2. In this section, you can adjust the report page name. Rename it to Product
Category & Color to provide an appropriate name to the page. Note: The Report
page name is immediately modified on the report's navigation bar at the bottom
of the report canvas page.

3. The following two options in the Name settings, Allow use as tooltip and Allow
Q&A, enable the report to be used as a tooltip in other visualizations and to
appear in a Q&A visualization's result. You do not need either of these for now, so
you can keep them as Off.
4. For the next configuration, expand the Canvas settings.

5. Here, you can identify the aspect ratio of the report page. The 16:9 Type
default provides 720 px (pixels) of height and 1280 px (pixels) of width, which
can't be modified.

6. Select any other ratio setting to apply a different aspect ratio or use Custom to
make modifications. The Custom setting lets you adjust the report page size to
your needs.

7. Modify Width to 1300 px to make the page slightly wider.


Step 3: Canvas background and Wallpaper

1. For this example, expand the Canvas background setting and select Browse in
the Image field.

2. Next, select the downloaded AdventureWorksLogo image. Select 85%


Transparency to make it slightly more visible.

3. The default Normal value in Image fit adjusts the image according to its
original pixel size. To fit it to the canvas, select Fit.
Note: Canvas background and Wallpaper are similar settings. Canvas background
applies a color or image to the canvas background, identified by the dotted black lines.
Wallpaper applies a color or image to the whole background as a wallpaper, filling the
screen with the selected color or image.

Step 4: Filters pane and filter cards

1. You can configure the Filter pane and its components in the final options of the
report page settings. Expand the Filters pane settings and the Filters pane itself
by selecting the arrow on top of it.
2. Select Georgia for Font and 13 for font size to adjust the Filters pane's font
settings.

3. In the Border setting, you can toggle the border to Off, making the Filters pane
appear connected to the Report page.

4. Finally, navigate to the Filter cards settings and expand it. Note that this section
has a State setting with Default and Applied options. This means you can
configure the filter cards to appear differently depending on the filter you've
selected. Note: Applied state is when a filter is selected, while the Default state
is when there is no filter selected.
5. Select Applied state. Then, navigate to Background settings and select a light
green color as the background color. Note that nothing changes on the Filters
pane, as no filter is applied.

6. Select the Country-Region filter on the Filters pane, and apply any filter, for
example, Australia. Observe that immediately when the filter is applied, the
background of the filter card will become green, highlighting that there is a filter
selected on the report.
Conclusion

The updates to Page Information, Canvas Background, and the highlighted Filters
cards are set to elevate the user experience. This careful curation ensures that the
report is informative and engaging, enabling users to interact with the data effortlessly
and extract the insights they need.
Module 3:

Activity: Use a custom visual

Introduction

Previously, you covered various techniques for formatting and configuring visualizations
in Microsoft Power BI, including visually adjusting and conditionally formatting. You also
explored how to modify the settings of the report page. In this activity, you'll be able to
apply your knowledge of formatting and configuring visualizations to apply custom
visualizations.

Scenario

The Sales Categorical Analysis report offers an easy-to-use country filter at the page
level. However, the stakeholders at Adventure Works are looking for a more engaging
and interactive experience. They have tasked Lucas with the challenge of incorporating
a visually compelling slicer that not only allows users to filter countries easily but also
enhances the dashboard's overall visual appeal. Lucas decides to search for a custom
slicer that will visually highlight the report.

Instructions

Step 1: Launch Microsoft AppSource

1. Download and launch the Sales Categorical Analysis.pbix report.

2. To add custom visualizations to the report, you need to access the Microsoft
AppSource. Select the ellipsis (…) symbol at the end of available visualizations to
do this. Then, select Get more visuals to launch the AppSource.
Step 2: Familiarization with the AppSource

1. All available custom visualizations on this page are ready to be implemented in


your reports. Adventure Works' admins can even suggest specific visualizations
from the Organizational visuals options.

2. For now, no visualization has been added here.


3. Use either the All or AppSource visuals tabs to navigate to the Filter by
dropdown menu and expand its options.

4. This menu offers a filter on all visual categories available in the AppSource.
Select Other to identify an appropriate slicer for the report.
Step 3: Custom visualization selection

1. On the Other page of the AppSource, various visualizations and slicers appear.

2. Identify the Chiclet Slicer in the list. Note: The blue tick on the right of the
visualizations indicates that this visualization is Microsoft certified. This means
that Microsoft has approved its functionality and performance, and the
visualization is safe to use in the report.

3. Select it to note its details. On this page, you can view a description of the
visualization, with some details and images related to its use.
4. Select Add to add it to the report.

Step 4: Custom visualization selection

1. The added custom visualization displays directly below the default visualizations
in the Visualizations pane. Select it to add it to the report.

2. Locate the Country-Region column in the Data pane and add it to the Category
field of the visualization.
Tip: Make sure Filters on this page is not filtering a single country on the filter pane, as
this would limit the slicer's options to just one.

3. Drag the edges of the two report slicers so that they align above the charts.

Step 5: Custom visualization configuration

1. Select the custom visualizations and navigate to its configuration settings.


Custom visualizations have their own set of Visual formatting options configured
by their developers.
2. On this custom visualization, select Chiclets to modify the slicer's options.
Adjust the font size to 14 pt to make the options more visible.

3. Also, toggle the Header option to off to hide the Country-region column name
from the chart, as it is unnecessary.
4. Finally, in the General settings, expand the Effects and turn off the Background,
as it overlapped the background.

Conclusion

Congratulations! You have successfully integrated a custom visual slicer into your
Power BI report. This allows you to present data in a more interactive and visually
engaging manner. As a Data Analyst, mastering the implementation of advanced
visual elements will help you create reports that not only tell a story with data but
also captivate your audience's attention, leading to more impactful data-driven
decisions.
Module 3:

Activity: Using the Play Axis visualization

Introduction

In this reading, you'll explore how to perform time series analysis in Microsoft Power BI,
emphasizing the importance of suitable visualization types like line charts, area charts,
and scatter charts.

Additionally, you'll delve into the use of the Play Axis visualization, available through
Microsoft AppSource, to create compelling and dynamic representations of time trends
and patterns in data.

Scenario

As Adventure Works' fiscal year-end approaches, the sales team shifts their focus
towards evaluating year-long results. A decision is made to put together a report that
highlights the team's achievements over the past year.

You take on the task of creating a time-series analysis report, delving into the sales data
accumulated throughout the year. However, you decide to add a surprising twist -
incorporating a Play-axis visual.

This dynamic feature not only enhances interactivity but also promises to grab
everyone's attention and provide a unique perspective on the year's sales performance.

For this example, you are developing a sales report. You decide to use two visuals, a
Scatter chart and Line chart, for the purpose of time series analysis and then enhance
those visuals with animation so the sales team can see how the sales data changes
over time.

Instructions

Step 1: Add a Line chart visual to the report

1. Download and open the Times series analysis PBIX file in Power BI Desktop.

2. Locate the Visualizations pane on the right of the Power BI interface.

3. Select the Line chart icon to add the chart to your report canvas.
4. In the Fields pane, identify the Sales Amount field in the Sales table.

5. Drag Sales Amount into the Y-Axis well of the Line chart. The Y-axis on the Line
chart updates with this information.

6. Next, locate and drag the Date field from the Date table into the X-Axis area of
the Line chart. The date is now represented on the X-axis, allowing you to
visualize how sales amounts have changed over time.
7. Finally, add Category from the Product table to the Legend area to break down
sales by category over time.

Step 2: Add a Scatter chart visual to the report

1. In the Visualizations pane, locate and select the Scatter chart icon.
2. Drag Order Quantity from the Sales table into the X-Axis well to determine the
value of each point in the Scatter chart.

3. Drag the Date field from the Date table into the Values well. This sets the
horizontal axis to represent time, showing how the Order quantity data points
are distributed over this period.
4. Finally, drag Sales Amount from the Sales table into the Y-Axis well.

Step 3: Import the animation custom visual

1. In the Visualizations pane, select the ellipses (...) which represent the Get more
visuals choice. Selecting the ellipses will allow you to explore additional visuals
that are not included by default in Power BI.
2. A Power BI visuals window opens with a Search bar in the top right. Type Play
Axis into the Search bar. The search result, Play Axis (Dynamic Slicer) will
appear in the window. Select this result.

3. The details of the Play Axis (Dynamic Slicer) option are now displayed. Select
the Add button on the left of the window to import this option and add it to your
available visuals.
4. A confirmation message appears indicating that the visual was successfully
imported.

Step 4: Resize and reposition the visual

1. The Visualizations pane now contains a new icon for the Play Axis visual. Select
this icon to add the Play Axis visual to the report page.
2. In the Fields pane, locate and drag the Date field from the Date table to the Field
well of the Play Axis visual.

3. The Play Axis visual now contains a new set of controls. These are animation
controls, which allow you to control how the Play Axis interacts with your data.

Step 5: Customizing the Visual

1. Select and drag the corners of the Play Axis visual to adjust its size. Select and
drag its Title bar to reposition it on the page.
2. You can use the choices in Animation Settings to control how the animation
behaves. Animation Settings is in the Visual tab of the Format visual pane on
the right of the Power BI window. Here, you can adjust settings such as whether it
starts automatically or loops continuously and control the speed of the
animation.

3. The Format visual pane also contains a Colors section. Here, you can make
changes to the appearance of the Play Axis visual, such as adjusting the color of
individual control buttons.
4. The final section in the Format visual pane, is titled Enable Caption On. This
allows you to turn the caption next to the visual on or off and adjust its
formatting, like font size and color.

Step 6: Using the Play Axis

1. Select the Play button on the Play Axis visual. This will start the animation,
demonstrating how your data changes over time.
2. You can use the control buttons on the Play Axis to pause, restart, or step
through the animation.

Conclusion

In this step-by-step guide, you learned how to integrate animation into your Power BI
visuals to explore data evolution over time. By adding animation elements, such as Play
Axis, you learned that you could enhance your reports and enable stakeholders to gain
deeper insights into time-dependent data patterns. Whether you're analyzing quarterly
sales trends, stock market fluctuations, or any time-based dataset, Power BI's time
series capabilities and animation tools can transform your data analysis into a visually
compelling and informative experience.
Module 3:

Activity: Exporting and Importing Themes

Introduction

In data analysis, the way information is presented can significantly impact audience
engagement and comprehension. The visual appeal and consistency of reports are just
as crucial as the data itself. When presenting multiple reports in a meeting or when
various teams from the same organization are showcasing their findings, it's vital to
adhere to a unified style guideline. This ensures that all reports not only look
aesthetically pleasing but also support accessibility, making them easier to understand
and follow.

Scenario

Imagine you are a data analyst at Adventure Works, tasked with ensuring that all reports
across the company maintain a consistent brand identity. You've developed a custom
theme that aligns perfectly with the company's branding guidelines. To achieve this
uniformity, you need to export this theme and guide your colleagues in other
departments on how to import it into their reports.

Your task is to follow the instructions, export the theme and then import and apply this
theme to another report.

Instructions

Step 1: Open the Power BI file in Power BI Desktop

1. Download the Activity-Theme-Export.PBIX file.

2. Open the file in Microsoft Power BI Desktop.

• You'll find that this report includes several visuals, and all of them have a
custom accessibility theme applied to them.
Step 2: Open the Themes menu

1. Go to the View ribbon and select the Themes dropdown. This will open the
Themes menu.
2. Scroll to the bottom of this menu and select Save current theme.

Step 3: Save the theme

1. A new popup window appears where you can select the location on your computer
to save this theme.
2. Give it a name, for example, CustomTheme, and select Save.

Step 4: Open the new report file

• Download the Activity-Theme-Export.PBIX file.


• Open the file in Power BI Desktop.
• You'll find that this report includes several visuals.

1. Go to the View ribbon and select the Themes dropdown. This will open the
Themes menu.
2. Scroll to the bottom of this menu and select Browse for themes.

Step 6: Apply the theme

1. A new popup window appears where you can select the previously saved theme
named CustomTheme.
2. Select it and then select Open.
Step 7: Confirm the import

• If the theme is successfully imported, it will prompt a new dialog stating that it is
now ready to use. Select Got it.

Step 8: Check everything

• Now the new theme has been imported and applied and the look of your report
has been changed.
Conclusion

The process of exporting and importing themes in Power BI is crucial for maintaining
consistent branding and ensuring a cohesive, professional presentation of data across an
organization. By following these simple steps, you have learned how to export a theme in
Power BI and then import and apply it to all your reports, thereby maintaining
accessibility and consistent brand guidelines.
Module 3:

Activity: Configure a bookmark

Introduction

Bookmarks in Microsoft Power BI serve as a dynamic tool for enhancing the interactivity
and functionality of reports. This reading introduces you to the concept of bookmarks,
exploring how they can transform the way you present and navigate through your Power
BI reports. You will specifically focus on applying bookmarks to a practical scenario, the
Sales Categorical Analysis report, demonstrating how they can be used to create more
engaging and informative data presentations.

Scenario

Lucas at Adventure Works has been given a critical task for an upcoming presentation.
The team requires a quick and efficient way to highlight the 2019 sales data for
European countries in the Sales Categorical Analysis report. This data is vital as it
serves as a benchmark for assessing current performance against the previous year's
success in a key market. To facilitate this, Lucas decides to use Power BI's bookmark
feature, creating an Europe 2019 bookmark to instantly access the relevant sales data
with precise filters and configurations.

Bookmarks in Power BI allow users to capture the current state of a report page,
including filters, slicers, and the visibility of visuals, that can be returned to, even when
these report configurations are modified. This enables users to save and later return to
specific views or configurations within a report, facilitating a more dynamic and
interactive approach to data presentation.
Bookmarks contain a series of configuration options:

• Update: This is the main button for creating and updating bookmarks. It allows
users to update an existing bookmark with the current state of the report. It
ensures the bookmark reflects the latest changes in filters, visuals, and other
settings.

• Data: When this option is enabled, the bookmark saves the current data view,
including filters and slicer selections. This is crucial for preserving a specific data
analysis state.

• Display: This controls whether visual settings like the expansion of charts or the
visibility of certain elements are saved. It is useful for maintaining the visual
layout of a report page.

• Current Page: Selecting this option ensures the bookmark only applies to the
current page of the report. It is ideal for reports with multiple pages, where each
page represents different data or analysis.

• All Visuals/Selected Visuals: This setting determines whether the bookmark


applies to all visuals on a page or only to those selected by the user. This
flexibility allows for more targeted bookmarks, focusing on specific aspects of a
report.

Instructions

You can choose to simply read and consider the following steps or, if you prefer, you can
follow along. If you decide to step through the activity as you read, you will first need to
download and open the Sales Categorical Analysis.pbix file.

Let’s help Lucas as he leverages the versatility of bookmarks to create a snapshot of the
report the users can easily navigate to.

Lucas launches the Sales Categorical Analysis report to configure his task of creating a
snapshot of the report, where the Europe Sales of 2019 are highlighted. To accomplish
this, he begins by selecting the exact configurations and filters the Europe 2019 state
should return to, so he selects all European countries from the Country/Region filter,
and the whole year of 2019 on the date slicer.
Step 1: Create the bookmark

The bookmark is now ready to be created. To access the bookmark menu, Lucas
navigates to the View tab, then Bookmarks, to enable the bookmarks pane.

Currently, no bookmarks have been created. Lucas selects Add to add a new bookmark
and names it Europe 2019. To save the current state of the report on the new bookmark,
he selects the ellipsis symbol on the right of the bookmark and then Update. When
doing this, he ensures that the Data option is enabled with a tick, forcing the filters to
revert to the bookmark state.
Step 2: Deselect filters

The current version of the report, with the filters in that state, is saved in the Europe
2019 bookmark. Deselect all filters from the report so Lucas can test how users can
seamlessly return to the bookmark filters.

Step 3: Create a button

To enable users to access the bookmark, a button must be created. Lucas navigates to
the Insert tab of the ribbon, selects Buttons, and then Blank. This adds a no-icon
button box on the report, that can be assigned specific actions in Power BI.
Lucas selects this new button to access its settings and enters the text Europe 2019 in
the Style section of the button settings.

Lucas scrolls down to the Action settings to assign an action when the button is
selected. He turns the toggle to On and on the Type section, and selects Bookmarks.

Lucas then selects Europe 2019 as the bookmark in the Bookmarks box below. The
button is now ready to be used.
Step 4: Examine the results

On the keyboard, Lucas olds down the Ctrl key and selects the button to witness the
result. No matter what filters were applied to the report before the selection, the button
transforms the report into the Europe 2019 state the bookmark was updated with.

Tip: Ctrl + select is used in Power BI Desktop so that report builders can easily access
the button’s settings with simple selecting. For the business users in Power BI Service,
the buttons require just a select with the press of the Ctrl button.

Conclusion

The incorporation of the Europe 2019 bookmark in the Sales Categorical Analysis report
exemplifies how Power BI's features can significantly enhance data presentations. By
enabling instant access to specific information, you not only improve the efficiency of
the presentation but also provide a clear benchmark for comparison. This approach
demonstrates the power of Power BI in making complex data more accessible and
actionable, a crucial aspect of today's data-driven business needs.
Module 3:

Activity: Create custom tooltips

Introduction

Tooltips in Microsoft Power BI are an essential feature for enhancing data interactivity
and providing additional context in reports. They offer a quick glimpse of detailed
information when users hover over elements in a visualization. In this reading, you will
learn about the creation of custom tooltips, a powerful way to tailor the information
displayed in these hover-over boxes. This capability elevates the user experience by
offering more depth and clarity in data analysis.

Scenario

Lucas, a data analyst with Adventure Works, has been assigned a new task of
enhancing the Sales Categorical Analysis report for the Adventure Works sales team.
The sales team needs an efficient way to access the distribution of order quantities for
each country directly from the column chart visualization. This is to check the count of
orders for each product category in each country. Lucas is set to explore the capabilities
of custom tooltips in Power BI, aiming to integrate detailed order quantity information by
category, which will provide immediate insights without navigating away from the chart.

What are tooltips in Power BI?

Tooltips in Power BI are small information boxes that appear when users hover over
elements within a report, such as charts or graphs. They provide additional context or
detailed data related to the element being examined. This feature is integral to
enhancing the data exploration experience in Power BI, offering immediate insights
without cluttering the visual.
Benefits of tooltips in Power BI

Let’s explore exactly what tooltips can offer you in Microsoft Power BI.

• Contextual information: Tooltips deliver relevant details about specific data


points, helping users understand the data better without navigating away from
the current view. Tooltips offer a way of adding context to the visualizations,
when additional information cannot fit on the chart.

• Enhanced data exploration: Tooltips enable users to delve deeper into the data,
revealing underlying details that are not immediately visible in the main
visualization.

• Customization opportunities: Power BI allows for the customization of tooltips,


enabling the display of specific fields, measures, and even visualizations tailored
to the report’s needs.

• Interactive experience: Tooltips contribute to an interactive and engaging user


experience, making data exploration more intuitive and insightful.

The use of tooltips in Power BI reports is a simple yet powerful way to enrich data
visualizations, offering a deeper understanding of the data immediately.

Instructions

You can choose to simply read and consider the following steps or, if you prefer, you can
follow along. If you decide to step through the activity as you read, you will first need to
download and open the Sales Categorical Analysis.pbix file.
Let’s follow along with Lucas as he tackles the task of adding order quantity per country
information on the Sales Amount by Category visualization.

Step 1: Launch the report

Lucas launches the Sales Categorical Analysis report. No custom tooltips have been
configured on the report yet, meaning that all visualizations contain the default tooltips.
Lucas can hover above any column in the column chart to identify the default tooltip of
the visualization.

Step 2: Create a custom tooltip

The column used in the visualization appears on the default tooltip. To make the tooltip
custom with more information added to it, Lucas navigates to the Tooltips field on the
Visualizations pane and starts adding columns. He will need the Order Quantity
number, so he adds it on the field box, using the Sum aggregation.
Now, when Lucas hovers over a chart’s column, the order quantity will appear for the
specified category.

Step 3: Add a field

For the distribution of the order quantity per country, let’s try adding the Country-
Region field from the dataset to the Tooltips field box. Selecting the arrow to the right of
the field on the tooltip, the field is aggregated by either First or Last country, or a Count
of country values. This happens because tooltips can only show a single value of a field
aggregated and not a list.
This makes showing the distribution of the number of orders per country impossible
using custom tooltips. Hovering over a column with the First Country-Region selected
as the tooltip field will display just France, as this is the first country alphabetically in
the current filter context.

Step 4: Create a custom tooltip page

To accomplish the requested result, a custom tooltip page must be created. Lucas
selects the + symbol to create a new blank page. Navigating to the report page settings,
he renames the page to Orders by Country and enables Allow use as a tooltip on the
Page information settings.
This will immediately make the page size smaller. Then, Lucas adds a pie chart in the
page, using Country-Region as the Legend, with Order Quantity as the Values. This is
the information you wanted to be depicted in the tooltip.

Tip: This page will only be used indirectly as a tooltip page, so users do not necessarily
need access to it directly. A good practice would be to right-click on the page’s name
and select hide, so users are unable to access it.
Step 5: Check the work completed

Lucas navigates back to the Product Category & Color report page. He selects the
column chart and locates the Tooltips section in the visualization’s general settings.

Lucas selects the Report page on the Type field box and selects the newly created
Orders by Country in the Page field box.
This is all you need to create a custom tooltip page. You can hover over a column in the
chart to look at the outcome.

The order country distribution is immediately available to users when hovering over the
column chart, effectively applying all filters from slicers and the column chart.

Conclusion

By successfully integrating a custom tooltip page into the Sales Categorical Analysis
report, Lucas has significantly enhanced the report's functionality and user experience.
The sales team at Adventure Works can now effortlessly access detailed order quantity
distributions for each product category and country, directly from the column chart.
This improvement not only saves time but also provides a deeper level of insight
immediately, demonstrating the powerful impact of customized tooltips in enriching
data interaction and analysis in Power BI.
Module 3:

Conditional formatting for buttons

Introduction

This article introduces conditional formatting in Microsoft Power BI. The technique and
its process are demonstrated by creating a button in a report that changes function and
destination according to user selection.

Scenario

Adventure Works requests a new Power BI report for the sales team, focusing on sales
specifically in Germany and Australia. The report must contain a slicer allowing users to
select between countries. Based on the user’s selection, a button in the report changes
its text to Germany or Australia and navigates the user to the respective country's sales
page, providing a customized data view.

Conditional formatting

Conditional formatting in Power BI refers to dynamically changing the appearance of


visuals, text, or elements based on certain conditions or user inputs. It allows elements
like tables, charts, and buttons to adapt visually in real-time as data or selections
change. This feature is particularly useful in enhancing the interactivity and user-
friendliness of reports, enabling data presentation to be more engaging and informative.
Applying conditional formatting to buttons involves utilizing data-driven expressions to
modify button properties, such as text and navigation, based on slicer selections or
other user interactions.

Let’s review an example where Lucas uses conditional formatting to add dynamic
navigation to a report.

The aim of this reading is to give you an example of how to add conditional formatting
for buttons. This is an example of the steps you would take if you had access to a Power
BI report.

In this example, you can read and explore the process of adding conditional formatting
to buttons.

Instructions

Lucas launches a simple report containing three pages. The first is the Navigation page,
where users can make selections that dynamically affect their navigation within the
report. This page has a slicer with the options Germany and Australia and a blank
button.
On the next two pages is a single table with Sum of Sales Amount per Category and
Country-Region. Both pages contain a Filter that limits the dataset to only the Country
that the respective page name displays.
Lucas must configure the button to dynamically change its text and navigate users to
the page for the country they selected using the slicer. Let’s explore how this can be
accomplished.

Step 1: Configure the button

1. For the report to act based on user selection, you need to create a field that will
save this information. This can be done using the following DAX
SELECTEDVALUE function on the Customer table:

SelectCountry = SELECTEDVALUE(Customer[Country-Region])
2. After entering the formula in the formula bar, press Enter. Your new measure,
SelectCountry, will now appear in the Fields pane. This function grabs the
Country-Region values selected by users in a report. This is how the
SELECTEDVALUE function can be used to use the selection on the Country-
Region field.

Step 2: Style the button

1. Select on the button on the Navigation page to select it. In the Format pane,
locate the Style section.
2. Within the Text sub-menu, select on the fx icon next to the Text field.

3. In the conditional formatting window, set the format style to Field value.

4. From the What field should we base this on dropdown, select the
SelectCountry measure and select OK.
5. Your button will now dynamically display the selected country. Whenever a user
selects a Country-Region on the report, the button displays the selected field.

Step 3: Configuring the report navigation

1. With the button still selected, in the Format pane, expand the Action sub-menu.
Toggle the state of the Action switch to ON.
2. Set the Type to Page navigation. This step is crucial as it defines the button's
functionality to navigate between pages.

3. Select on the fx icon next to the Destination dropdown.


4. In the Destination window, set the format style to Field value.

5. From the What field should we base this on dropdown, select the
SelectCountry measure and select OK.

6. To ensure this works, just apply the measure leveraging the SelectedValue on
the field box. The button now navigates the user to the page that shares the same
name with the slicer selection!
Tip: The dynamic navigation is case-sensitive. This means that even a misplaced
lowercase letter instead of a capital may break the navigation, as the following
examples shows:

Conclusion

In this reading, you’ve discovered how conditional formatting in Power BI can


dynamically alter the text and destination of a button based on user selections. This
technique can be applied to enhance the interactivity of a report, allowing users to
navigate data seamlessly. This skill is crucial for creating more responsive and user-
friendly Power BI reports that provide tailored insights.
Module 3:

Activity: Apply sorting

Introduction

Sorting is a fundamental feature in Microsoft Power BI that significantly enhances data


analysis through organizing data in a meaningful order. This reading explores various
sorting techniques within Microsoft Power BI, emphasizing their importance in data
visualization and interpretation. You will cover basic visualization sorting, the advanced
technique of sorting by another column, and delve into sorting settings and behaviors.

Scenario

Lucas is faced with a new challenge in the Sales Categorical Analysis report. The
management team has requested adjustments to how the data is sorted in several key
visualizations on the Details page of the report. They want the report to better reflect
current sales priorities and trends. Lucas's task is to utilize various sorting techniques in
Power BI to reorganize the data in these visuals.

What is sorting in Power BI?

Sorting in Power BI refers to the process of arranging data in a specified order within
visuals. It is a crucial feature that helps to organize data in ascending or descending
order, based on numerical values, alphabetical order, or other specific criteria. By
default, numerical data is sorted by value, while textual data is organized alphabetically,
both in ascending and descending order according to the business needs.

You can choose to simply read and consider the following steps or, if you prefer, you can
follow along. If you decide to step through the activity as you read, you will first need to
download and open the Sales Categorical Analysis.pbix file.

Let’s explore how you can help Lucas to leverage sorting techniques to enhance the
story-telling power of the Sales Categorical Report, on the two visualizations of the
Details page.

Instructions

Step 1: Adjust table visualization sorting

Let’s begin by adjusting the sorting of the table visualization.


To access the sorting method used on any visualization, select it and navigate to the
ellipsis symbol in the top-right of the screen. Selecting this symbol makes the
visualization’s settings appear, where the sorting options can be found. The table is
currently sorted by Product in ascending order.

Select Color and Descending to check how the table is modified.


The table is now sorted by Color in descending order, with Yellow products appearing
first. In tables, you can add a second sorting method by holding the shift key down and
selected another column. For example, hold down shift and select the Sales column.
Two down arrows appear on the table, meaning that the table is now sorted in
descending order, first by color, and then by sales value.

Step 2: Sort by another column

For a more complex example, let’s consider the line chart. The line chart is sorted in
ascending order by Sales amount, which has mixed the months of the X-axis in an
unchronological sequence, making the chart difficult to understand.

Select the ellipsis symbol on the visualization and sort the axis by MonthName.
The visualization is now sorted by MonthName which is a text field, so it is in
alphabetical and not chronological order. To solve this problem, you will need to sort the
month names by another column. To do this, locate the MonthName field in the Data
pane, and select the Column tools tab in the ribbon.

From there, select Sort by Column to sort month names by another field. Select
MonthNumber, as this would solve the sequence issue.
The MonthName column is now always sorted by the MonthNumber column, and the
line chart is now correctly displaying the months in order.

Sorting retention and behaviour

But what happens to the sorting methods used when the report is published in Power BI
Service? In Power BI Service, the reports are published with the author’s filters and
sorting methods. If you make any sorting changes on top of the author’s default settings,
these modifications are saved on your instance of the report. If you leave and later
return to the report, your sorting adjustments are retained. To revert to the original
settings applied by the report designer, use the Reset to default option.
Conclusion

Concluding our exploration of sorting in Power BI, you learned how this feature is pivotal
for organizing and interpreting data effectively. From basic visualization sorting to
advanced techniques like sorting by another column, and understanding sorting
settings and behaviours, these tools empower users to present data logically and
meaningfully. The ability to retain sorting changes, coupled with options like Reset to
default and personalization through bookmarks, further demonstrates the versatility of
Microsoft Power BI.
Module 3:

Activity: Using the Q&A feature for reports

Introduction

In business intelligence and data analytics, the ability to effortlessly query and interpret
data is paramount. Microsoft Power BI Desktop offers a feature that transforms the way
users interact with the data, the Q&A feature. The users can create quick visuals by
asking questions through natural language queries and user-defined terms for intuitive
data exploration.

Scenario

Adventure Works operates worldwide, managing a vast product portfolio with regional
sales teams. The company faces critical decisions each day, such as product
prioritization, inventory management, and sales strategy adjustments which need real
time sales data. The sales team is comprised of individuals from diverse backgrounds
and not all of them are data experts. They need to swiftly access insights from the data
without creating complex reports and querying databases. Power BI’s Q&A feature
steps in to assist users to query data using natural language.

Instructions

In this activity, you will create visuals by using Q&A visualization in Power BI Desktop.

Step 1: Download Adventure Works Sales Excel workbook

• Download the Adventure Works Sales.xlsx workbook and load the sheet to the
Power BI data model. The sheet contains four data tables: Sales, Products,
Salesperson, and Region. Make sure the dimension tables are related to the
fact table via one-to-many relationships and single cross filter direction. When
you load the data, Power BI automatically detects the relationships based on the
key columns.
Step 2: Create Q&A visual

1. The data model contains sales information by salesperson, region, and


products. This will help you write the questions. Select the Q&A visual from the
Visualizations pane.

2. A Q&A box appears on the Report canvas. The box provides suggestions, or you
can write your own question in the text box.
3. For instance, if you write “Show me the total sales by salesperson as bar chart”, a
bar chart is created.

4. When you write your question, Power BI provides autocomplete suggestions to


guide you in completing questions though natural language. You can also
configure the suggestions by teaching Power BI about synonyms and adjectives.
5. Next, you can convert the results of your question to a standard visual. Select the
icon beside the text box, Turn this Q&A results into a standard visual.

6. Now you can format the visual as per your design needs.
Step 3: Configure Q&A

1. You can add synonyms for the fields in your dataset. For example, the Region
table contains a Country column. A user might ask the question Show me the
total sales by geography. You can add geography as a synonym for Country.

2. Create a new Q&A visual and write show me the total sales by geography.

Note: Geography is underlined with red and below the visual asks you to define
geography.

3. Select the gear icon on the top right of Q&A visual.


4. This opens a Q&A setup window. Select Synonyms from the left bar and scroll
down to the Region table. In the Country section select Add and write
geography.

Note: Geography is now underlined with blue, meaning Power BI recognizes the
term.
5. You can convert the results to a visual and format it as you would typically do.
Likewise, you can add synonyms for other fields as per your business
requirements.

6. You can also configure the Q&A feature to define relationships and teach it to
better understand the specific terms relevant to your business.

Step 4: Save your project

• Save your Power BI project to your local machine, make sure to provide an
appropriate path so that you can retrieve the file for later use.
Conclusion

Power BI’s Q&A feature provides the freedom of creating visuals on the fly. Both
report users and analyst can benefit from this feature. You can train the Q&A for the
specific terms, synonyms, and review questions that are specific to your analytical
and business needs.
Module 3:

Activity: Add the Q&A feature to a dashboard

Introduction

In this reading, you will explore how the Q&A feature aids in the process of creating
visualizations in Microsoft Power BI. It marks a significant leap by enabling business
users to craft their own detailed visualizations using straightforward language. This
advancement bridges the gap between complex data analysis and non-technical users
limiting the dependency on technical report builders to deal with all required tasks from
stakeholders.

Scenario

Lucas, a data analyst with Adventure Works, is tasked with creating a new visualization
to be added to the Sales Categorical Analysis dashboard. The requested visualization
is a funnel chart that shows the total sum of sales by country-region with all blank
country values excluded. You will explore how funnel chart visualization settings can be
created in Power BI Desktop, as well as using the Q&A feature in Power BI Service. You
will then perform a side-to-side comparison of creating this chart manually in Power BI
Desktop against creating it using the Q&A feature in Power BI Service.

Q&A feature

The Q&A feature in Power BI is designed to allow users to generate visualizations


through natural language queries. This functionality is integrated into dashboards and
reports, ensuring easy access for all levels of users. It offers intelligent suggestions and
guidance, aiding users in formulating their queries more effectively. This feature makes
the data visualization process more user-friendly and interactive.

Some of the benefits of the Q&A feature include:

• Ease of use: It simplifies complex data analysis, making it accessible to non-


technical users.

• Efficiency: It speeds up the process of generating visualizations, aiding quick


decision-making.

• Empowerment: It enables business users to independently explore and


interpret data, fostering a proactive approach to data analysis.

Let’s compare the two methods to create a Q&A visualization in Power BI Desktop and
in a dashboard.

Instructions: Creation of visualization in Power BI Desktop

To follow this activity, download and open the file Sales Categorical Analysis report.
Step 1: Select the chart to create the visualization

For the first method, let’s create the required visualization with Power BI Desktop. In a
blank page, select the funnel chart to add it to the report page.

Step 2: Add the values

Select Country-Region as the visualization’s category, and Sales Amount to apply the
Sum of Sales Amount calculation as the values.

There are dataset rows with no Country-region value, which is why the visualization
shows (blank) values.
Step 3: Clean the data

To clean the data, navigate to the Filter pane, and on Filters on this visual, remove the
(blank) values.

Step 4: Save and publish the report

The requested visualization is ready, so you can now save the report, publish it on the
designated workspace and pin it on the requested dashboard to provide users access to
it.

Now, let’s explore the second method; how a business user can create this visualization
without having experience with Microsoft Power BI, using the Q&A feature.

Instructions

Follow these steps to explore the creation of visualizations with the Q&A feature in a
dashboard.

Step 1: Access the Q&A feature

Navigating to the Sales Categorical Analysis dashboard on Power BI Service, let’s use
the Q&A feature to create the same visualization.
Below the dashboard’s ribbon, locate the Ask a question about your data field. This is
where users can access the Q&A feature. You can select it to navigate to the Q&A
feature window. In the Q&A feature, there are several suggestions to get started with
creating visualizations, and a text box where you can start typing. Let’s start creating the
visualization step-by-step.

Step 2: Enter the calculation

Start mentioning the calculation by entering “Sum of Sales Amount”. A simple card
visualization highlighting the total of sales amount will appear.
Step 3: Enter the chart type

Next, type the chart you want to use. In this case “funnel chart”. A funnel chart with a
single row will appear on-screen.

Step 4: Detail the context

Let’s give the calculation some context. Type “by Country-Region” on the end of your
text to use this field as a category.
Step 5: Remove any blank values

The last step is to remove the blank values. You can do this directly from the Filter pane
on the right, as you did in Power BI Desktop, but let’s explore how it can be done with
natural language.

Simply type “without blank” on the end of your text. The natural language processor will
immediately associate “without” with a filter, so the visualization is now ready!
You can now select Pin visual in the top right of the screen to add it on the dashboard.

Select the existing dashboard being used and select Pin.


The new visualization is now added on the dashboard, using nothing but natural
language to create it!

Conclusion

Microsoft Power BI's Q&A feature represents a significant stride in data visualization
and analysis. By enabling business users to use natural language for creating complex
visualizations, it simplifies data analysis, making it more accessible and efficient. With
tools like this, the barrier between technical expertise and insightful data interpretation
is greatly reduced, opening new possibilities for data exploration and business
intelligence.
Module 3:

Activity: Anomaly detection

Introduction

As a data analyst, you play a key role in your company's decisions. Your daily job
involves analyzing complex data to find important insights that affect the business.
Anomalies in data are crucial, as they offer chances to learn and make improvements.
Anomaly detection in Power BI is a key tool in this process.

Anomaly detection

Anomaly detection in Power BI is a feature that helps you spot unusual patterns in a
dataset. These unusual patterns, or anomalies, stand out from most of the data. The
feature uses advanced algorithms to understand normal trends in historical data. It
then highlights any unusual deviations, pointing out potential areas that might need
attention. This tool offers various benefits that improve data analysis and decision-
making. Let’s explore some of the key benefits that anomaly detection provides:

• Early Warning System: Anomaly detection acts as an early warning system,


letting you know about sudden changes in data. This helps businesses react
quickly to problems, like noticing a drop in product quality or an increase in
customer complaints, before they get worse.

• Enhanced Business Insights: Identifying anomalies can also help you find
important insights that you might miss. For instance, noticing a sharp rise in
sales after a marketing campaign can show you which strategies are working
well, helping you make better business decisions.

• Time-Efficient Analysis: Manually searching datasets for unusual data is slow


and can lead to mistakes. Anomaly detection automates this, quickly finding
irregularities in the data, which saves time and effort.

• Improved Data Quality: Anomalies can point out errors or inconsistencies in


data. Finding these anomalies helps keep the data accurate and high-quality,
making sure analyses and reports are based on trustworthy information.

While anomaly detection in Power BI is a powerful feature, it does have some


limitations. These limitations are:

• No Support for Live Connection: Anomaly detection in Power BI can't be used


with live data. This means if your data, like stock market feeds or live transaction
data, is updating in real-time, you can't use anomaly detection on it directly.

• DirectQuery Connectivity Not Supported: Power BI's anomaly detection can't


be used with DirectQuery. DirectQuery lets you access large datasets directly
without importing them into Power BI. But, anomaly detection needs data to be
imported, so it's not ideal for very large datasets where importing is impractical
or takes too long.

• Lack of Drill-Down Capability: Anomaly detection doesn't allow you to drill


down into details directly from the anomaly point in the visual. This means if you
find an anomaly, you can't immediately look into more specific or detailed data
about it. This limitation can be a problem when you need to understand the small
details of an anomaly for analysis.

• Limited Customization: The anomaly detection tool in Power BI is a set model


that you can't change much. You can tweak its sensitivity and how it looks, but
you can't alter the basic statistical model or pick different methods for detecting
anomalies.

Instructions

1. Download Sales.pbix and open the report file in Power BI Desktop.

2. In the Visualizations pane, find and select the Line Chart icon. Line charts are an
effective way to visualize data trends over time, making them ideal for spotting
anomalies in time-series data.
3. Drag and drop the fields Purchase Date for X-Axis and Sales Amount for Y-Axis.
This determines what data is displayed on your chart and how it's organized,
which is key for identifying trends and, subsequently, anomalies.

4. Select the line chart to focus the Power BI interface on your chart, preparing it for
further analysis.

5. On the right-hand side, locate and select the Analytics icon on the visualizations
pane. This pane contains advanced analytical features, including the option for
anomaly detection.
6. Upon toggling Find Anomalies to an ON status, Power BI applies its built-in
algorithms to identify anomalies based on the data in your chart.

7. To access formatting options, expand the Anomaly sub-menu. This area allows
you to customize how anomalies are displayed, which is important for making
them stand out.
8. In the Anomaly section, Set the color to #E56E1D, marker type to Square, and
marker size to 6. These adjustments not only enhance the visual appeal but also
draw attention to potential areas of interest or concern in your data.

9. In addition to finding anomalies, Power BI lets you automatically understand


them. Hover over an anomaly and select it. Power BI then analyzes your data to
find possible reasons for the anomaly. It provides an explanation in natural
language and lists associated factors, ranked by their relevance to the anomaly.
10. In the Find Anomalies Options section, add the Country field to get more
detailed explanations. Setting up explanations this way helps you use your data
better by letting you look at it from various perspectives, giving a fuller
understanding of the detected anomalies.

Conclusion

Data analysis is a continuous process. Tools like Power BI's anomaly detection enhance
your skills. Make the most of them, know their limits, and let your curiosity and creativity
guide you. Each anomaly or unusual data point is a chance to investigate, ask
questions, and learn more.
Module 3:

Activity: Grouping data

Introduction

So far in this lesson, you have explored the grouping and binning features in Microsoft
Power BI. You learned how to configure them in a report and reviewed how their
application can improve the impact and appearance of the visuals used. This activity is
designed to give you an opportunity to put some of this learning into practice. You will
apply grouping to the data in a Power BI report to create a new level of information for
your colleagues.

Scenario

As one of the data analysts in Adventure Works, you’ve been asked to prepare a report
for the sales team, which includes information about the number of orders that have
been shipped, cancelled, or are currently in the processing stage. The team leader has
requested that the sales report should distinguish the shipped orders separately. They
have also requested the orders showing a status of cancelled and under processing
orders together. As a result, the final report will present this combined total.

Instructions

Step 1: Download and open the Power BI file

1. Download the Activity-Grouping-Data.pbix Power BI report.


2. Open it in the Power BI Editor. The report page contains a clustered bar chart that
visualizes orders categorized by their fulfillment status - shipped, cancelled, and
processing.

Step 2: Begin the create group process

• The team leader of the sales team has requested that the visual should clearly
show the status of the orders. They want the shipping orders to be distinguished
separately and those orders which were cancelled, or which are being processed
shown together. To achieve this in the chart, the new data grouping must be
based on the order status. Right-click on the order status field in the Legend and
select New group.
Step 3: Select data fields to add to the group

• Press and hold the control key on your keyboard and then select the Cancelled
and Processing entries under the Ungrouped values heading. If properly
selected, their background will be slightly dimmed.

Step 4: Add the data fields to the group

• Select the Group button. The two fields that you selected in the previous step
will now appear on the right-hand side of the Groups dialog in the Groups and
members section.
Step 5: Apply the choices and create the group

• Select the Ok button to finish creating the group.


Step 6: Confirm the results

• The clustered bar chart on the report page should now update. Because of the
grouping applied to the data field it now displays shipped orders separately
alongside a grouping of orders that were either cancelled or in the processing
stage.

Conclusion

It is important for any business that the visuals created in Power BI reports are clear and
comprehensible. They should also present the insights gained through data analysis in
the most effective way. By completing this activity you have applied techniques
demonstrated in this lesson and have used grouping to create a report which contains
the specific information requested by both the team and the team manager. Your
experience of how to group data based on field values will be a useful skill for creating
clear visuals and improving your data analysis in Power BI.
Module 3:

Activity: Binning data

Introduction

In this lesson, you learned about the grouping and binning features in Microsoft Power
BI and explored the benefits of applying them in a Power BI report. This activity is
designed to give you the opportunity to implement binning and experience how it can
improve the appearance and impact of the data in a visualization.

Scenario

As a data analyst in Adventure Works, you’ve been asked to fine-tune a report you
created for the sales team which covers the orders shipped during the months of
February, March, and April. The team leader wants to have a breakdown of the number
of orders shipped within different order value ranges. You decide that creating bins, with
intervals of 5000, will provide the information and insight the team leader requires.

The final visual in the report will have a clear and organized layout that managers can
easily obtain insights from.

Instructions

Step 1: Download and open the Power BI file

1. Download the Power BI report Activity-Binning-Data.pbix.


2. Open it in the Power BI Editor. The report page contains a clustered bar chart that
visualizes the shipped order quantities for the different sales regions of Asia,
Europe and North America.

Step 2: Define the bin

1. The sales team leader wants to have a breakdown of the number of orders
shipped within value ranges. You’ve decided that creating bins with intervals of
5000 will achieve this. Since you are creating the bins based on the total sales
amounts, right-click on the Order Total field on the data pane and select New
group.
2. In the Group dialog, enter 5000 in the Bin size text field.

3. Select Ok.

Step 3: Apply the bin to the clustered bar chart

1. Confirm that there is now a new field named Order total (bins) in the data pane
on the right.
2. Drag this new field into the Legend field well. The chart visual will immediately
update. The order quantities are now displayed in the different order value
ranges.

Conclusion

In this activity, you worked through the steps to bin data in a Power BI report. By binning
the data on value intervals, you have provided new insights to the sales team who use
the report.
Your experience with this feature will not only be useful for the Microsoft PL-300 exam. It
will be an important skill throughout your career as a data analyst for creating clear
visuals with more insights and improving your data analysis process in Power BI.
Module 3:

Activity: Using the Analyze feature

Introduction

As you have already learned, the Analyze feature in Microsoft Power BI is a powerful tool
that can help analysts identify trends and patterns in data. This activity is designed to
allow you to review what you have learned about the Analyze feature and to put it into
practice by analyzing sales data in a Power BI Report.

Scenario

One of your recent tasks as a data analyst in Adventure Works was to compile a sales
report containing data spanning the months of February, March, and April. The Power BI
report that you presented to the stakeholders showed a slight increase in sales in April
compared to the previous month. They have queried this increase and would like to
understand the contributing factors that drove the sales numbers higher in April. They
also want to identify the product category that had the most substantial effect on the
overall sales increase.

To address these inquiries, you can leverage Power BI's integrated Analyze feature. This
hands-on activity will guide you through the process of utilizing this tool to uncover the
insights needed to obtain the information requested by the stakeholders.

Instructions

Step 1: Download the Power BI report file

• Download the Power BI file Activity-Analyze-Data.pbix and open it in the Power BI


desktop. Currently, there are no visuals on the report page, but the dataset is
loaded.
Step 2: Add a chart visual showing the sales data to the report page

1. Add a Line chart visual to the report page. Resize the visual so that it expands to
fill the page.

2. With the Line chart selected, include Month from the Order Date Hierarchy and
the Order total field. Add Month to the X-axis field well and add Order total to
the Y-axis field well.
Step 3: Open the Analyze feature

1. Now it’s time to use the Analyze feature in Power BI to gain further insights. Hover
the mouse on the data point for April and right click on it to open the shortcut
menu. Select Analyze from the initial menu, and then Explain the increase.

2. Confirm that the Analyze window containing useful information on the data point
opens to the right.
Step 4: Address the stakeholder queries

1. Locate the largest increase in sales by scrolling down to the section that displays
this information. You can use the information generated here to identify the
factors that played a vital role in the sales increase in April and identify the
products and region which contributed most to this sales surge.

2. For instance, based on the result of this analysis, you have learned that the
Product Subcategories such as Mountain, Adventure and Cyclocross bikes
experienced the most significant surge in sales.
Furthermore, when examining Product Regions, you found that Europe and Asia did
well and showed the most substantial sales growth.
These are valuable conclusions and provide answers to the questions asked by the
stakeholders.

Conclusion

By completing this activity you have discovered how the Analyze feature can offer
insights on trends in the information displayed in a Power BI report. Using this
powerful feature, you will be equipped to provide immediate, data-driven responses
to stakeholders, offering them enhanced clarity on the dataset, which in turn will
inform more strategic decision-making for future plans.
Module 4:

Activity: Create a workspace

Introduction

Microsoft Power BI workspaces provide a collaborative environment for sharing


business intelligence content like reports, dashboards, datasets, and dataflows. You
can also create and store Power BI reports directly in your workspace area. In this
activity, you will create a workspace using the Power BI service.

Scenario

Picture yourself as Adventure Works' top Power BI data expert. You’ve been tasked with
building a workspace using the Power BI service where team members can easily add
their data, reports, and dashboards to work together.

Instructions

Step 1: Open your Power BI online service and log in to your account

• Go to https://app.powerbi.com and login with your email and password. You will
be taken to your Power BI service homepage.
Step 2: Open Workspaces

• On the left side of the page, there is a navigation bar. Select the second last icon,
called "Workspaces".

Step 3: Create a new workspace

• By default, a workspace named My Workspace is present in the Power BI online


service. Select+ New workspace to create a new workspace.

Note: when you create a new workspace it gets created within the Workspace section.
Step 4: Add workspace name and description

1. On the right side of the screen, a new pane named Create a workspace will
open.

2. Add the workspace name and a description to your newly created workspace.
You can also add an image or icon as a logo for the workspace.

3. Select Apply.
Step 5: Apply changes and upload content

• You will be taken to this newly created workspace. From here you can start
uploading content to this workspace.

Conclusion

Creating a workspace in Power BI Service is a simple process that can be done in a few
steps. Workspaces are shared environments for groups to collaborate on creating
dashboards, reports, and datasets. By creating a workspace, you can add other people
to the workspace and give them access to edit or read the content. It's important to note
that the number of workspaces you can create depends on the license you have.

Additionally, you should avoid using the Workspace tab to share content with others
because it is a personal workspace that may also contain other reports. Instead, you
should create a new workspace and give it a unique name and description. By following
the steps outlined in this guide, you can easily create a workspace in your Power BI
Service area and start collaborating with your team.
Module 4:

Publish, import, or update assets in a workspace

Importing content in a Power BI workspace

Importing introduces assets developed in other workspaces or Power BI desktop apps


into a new or an existing workspace. To import assets to a workspace, follow these
steps:

1. Navigate to the workspace, select Upload, and select the resources from your
computer.

2. Import as many Power BI files as you want.

3. After uploading the files, they will look like this in your workspace area in the
default list view.
4. You can also find your files in lineage view, which shows how they relate to each
other.

Updating content in a workspace

Updating maintains assets by applying incremental changes. If you want to update an


existing content in your workspace, simply upload the updated file. This will ask you if
you want to replace the existing file. From here you can select cancel or proceed to
replace the older file with the newer one.
Also, there are a few other important points you need to remember regarding this
update process.

Over time, data sources may be updated with new information, or there may be changes
in the design of the reports or dashboards. To ensure that users always have access to
the latest insights, assets like datasets in Power BI need to be updated.

Automatic updates: If your data source is set up with a scheduled refresh in Power BI
Service, the reports and dashboards linked to it will be updated automatically based on
the refresh frequency.

Manual updates: For datasets that are not on a scheduled refresh or for immediate
updates:

1. Navigate to the dataset in the Power BI Service workspace.

2. Select More Options (often represented by three dots) and select Refresh Now.
3. Additionally, if there are changes made to the report design in the Power BI
Desktop and you republish the report, the existing report in the Power BI Service
workspace will be overwritten with the new design.

Publishing content in a workspace

Publishing introduces new artifacts into a workspace. Follow these steps when
publishing to a workspace.

Develop and design the asset in the Power BI Desktop app and thoroughly test the
asset's functionality - including all visuals, filters, slicers, and drill downs. Resolve any
issues.

Once the asset is ready for release, select Publish from the Home tab ribbon
In the publish dialog, choose the appropriate workspace to publish it to. This is typically
a team or department workspace.

After publishing, verify all credentials and connections for datasets and dataflows are
correctly inherited in the published artifact. Re-enter any missing credentials.

A final validation is required so that all visuals, filters, slicers, drill downs work correctly
after publishing.

Conclusion

Effectively managing assets in Microsoft Power BI requires understanding the


procedures of importing, publishing, and updating. These tasks are crucial for ensuring
that data insights are timely, accurate, and actionable. In this article, you have learned
how to perform these actions in Power BI.
Module 4:

Activity: Apply sensitivity labels

Instructions

Step 1: Open the workspace

1. Open the workspace where you created your dashboard.

2. With the dataset, report, and dashboard files in your workspace, take note of the
sensitivity column.

Step 2: Apply a sensitivity label

1. On your dashboard, select more options (…). Then, select Settings.


2. From the Settings panel on the right-hand side, you will find the Sensitivity label
section at the bottom.

Step 3: Apply the Confidential label

1. Select the dropdown and choose any of your preferred labels. For this activity,
let’s select the Confidential label. Then select Save.

2. The sensitivity label has now changed for the dashboard in your workspace.
3. Select the dashboard to open it, and the sensitivity label will be located beside
the dashboard name.

4. You can also change the sensitivity label anytime by selecting this label and
choosing the appropriate label.
Conclusion

Sensitivity labels in Microsoft Power BI are essential for classifying and protecting data
according to its privacy level. They help organizations manage data security,
compliance, and access control, ensuring that sensitive information is handled
appropriately throughout its lifecycle.

In this activity, you have successfully applied a sensitivity label to your dashboard.
Module 4:

Activity: Create dashboards

Introduction

Microsoft Power BI workspaces provide a collaborative environment for sharing


business intelligence content like dashboards, reports, datasets, and dataflows. You
can also create and store Power BI dashboards and reports directly in your workspace
area.

In this activity, you will create a dashboard inside your workspace using a previously
created Power BI report.

Instructions

Step 1: Download and publish the Sales Report

1. Download the Sales Report.pbix Power BI File and publish this report to your
workspace. After successful publishing, your workspace will contain a dataset
and a report called “Sales Report.”

Step 2: Open the Sales Report

1. Open the Sales report inside your workspace. Select the sales report name, and
it will open inside the Power BI editor.

2. This report has five pages, and each of these pages contains some visuals.
Step 3: Pin visuals to the dashboard

1. It’s time to pin these visuals to a new dashboard. To do that, hover on each of
these visuals, and select the pin visual.

2. The first time you select this pin visual, you will be prompted with a new window
where you can select an existing dashboard or type the name of a new
dashboard. This time, type a name like “Sales Dashboard” and select Pin.
3. Repeat this process for the second visual. This time when you select the pin
visual, that same dialog box will open. Select Existing Dashboard and from the
dropdown select the newly created Sales Dashboard.

4. Repeat the same process for the third visual on Page 1.

Open Page 2, 3 and 4 repeat this pinning process for the visuals on these pages. Each
time select the existing Sales Dashboard for pinning.
Step 4: Open the Sales Dashboard workspace

1. Open your workspace by selecting the workspace icon on the left sidebar. This
time you can explore all the previous files and the newly created Sales
Dashboard.

2. Select the Sales Dashboard file. It will open in the Power BI editor inside your
workspace. This time it will appear with disorganized visuals.
Step 5: Reposition and resize visuals

1. You can reposition and resize these visuals just like you would in your Power BI
editor.

2. Feel free to drag them to their appropriate positions, resize each visual as
necessary, and arrange them neatly to create an organized layout.
Step 6: Pin report page to a dashboard

1. You also have the option to pin an entire page from your report to either a new
dashboard or an existing one. To achieve this, revisit your workspace and locate
your report file labeled Sales Report.

2. Open the report in the editor and navigate to Page 5, where you'll find a pre-
designed dashboard.

3. Select More options(…) on the top.


4. It will open a new dropdown menu. Select Pin to a dashboard and then select
your existing Sales Dashboard from the box and select Pin live.

5. Now return to your workspace and open the Sales Dashboard. Notice how this
new page has been added at the bottom of your dashboard.
Conclusion

In this activity, you have explored the capabilities of Power BI workspaces, a


collaborative hub for sharing and creating business intelligence content. By following
the outlined steps, you have successfully created a new dashboard within your
workspace. This dashboard is now populated with visuals pinned from a Power BI
report, each thoughtfully organized and positioned to create an efficient and visually
appealing layout.
Module 4:

Activity: Configure a dataset scheduled refresh

Introduction

In this exercise, you will install a personal data gateway, set it up with your Microsoft
Power BI account, and then configure a scheduled refresh for a dataset inside the
workspace.

Scenario

Imagine you work at Adventure Works, and your task is to create insightful reports
tracking sales performance across regions. Without a data gateway, you have to
manually update these reports with the latest Excel data. That process is time-
consuming and error-prone. However, by following the steps in this activity to install and
configure a personal data gateway in Power BI, you can automate the data refresh
process. In that way, your reports will seamlessly update at specified intervals, ensuring
that your team always has access to the most current sales data, saving time and
ensuring data accuracy for better-informed decisions and business growth.

Instructions

Step 1: Download the Power BI data gateway (personal mode)

• Visit this URL https://powerbi.microsoft.com/en-us/gateway/ and download the


Power BI data gateway personal mode application.
Step 2: Install the gateway

1. Open the downloaded installer and start the installation. It will ask for the email
address of your Power BI service account.

2. Sign in with your email address and password. It will show that the application is
running and is online. Leave it running.

Step 3: Begin a schedule setup

1. Now open a Power BI Report and publish it to your workspace.

2. Then, in your workspace, hover over a previously published dataset for which you
want to set up a schedule refresh.

3. Select Schedule refresh, beside the dataset name, to start setting up the
schedule refresh for this dataset.
Step 4: Check the gateway connection

1. Check the next screen, which has various settings for your dataset. If your
gateway is properly connected with your Power BI service, you will see a
Gateway and cloud connections section here.

2. Scroll down and open the Gateway and cloud connections section.
Step 5: Edit credentials

1. Scroll down to the Data source credentials section and open it.

2. Select Edit credentials.

Step 6: Credentials settings

1. In the Configure popup, select Windows without Impersonation as the


Authentication method

2. Then select Organization as the Privacy level setting for this data source.

3. Select Sign In and you are done with your gateway configuration.
Step 7: Refresh interval

1. Scroll further down and open the Refresh section. The refresh schedule is set to
Off by default.

2. Turn the refresh schedule to On.

3. Select Refresh frequency and Time zone.

4. You can also set the Time manually.


5. Select Apply, and you are done.

Conclusion

In this activity, you learned how to install a personal data gateway, set it up with your
Microsoft Power BI account, and configure a scheduled refresh for a dataset inside your
workspace. This knowledge is crucial for ensuring that your Power BI reports and
dashboards are up to date with the latest data, providing accurate insights for better
decision-making.

You might also like