Download as pdf or txt
Download as pdf or txt
You are on page 1of 48

Power BI

Dashboard in a Day
Lab 2

Version: 10.20.2023 Copyright 2023 Microsoft 1 | Page


Maintained by: Microsoft Corporation
Contents
Introduction ............................................................................................................................................... 3
Power BI Desktop – Data Modeling and Exploration ................................................................................... 4
Power BI Desktop - Layout ...................................................................................................................... 4
Power BI Desktop – Data Exploration ..................................................................................................... 8
Power BI Desktop – Data Exploration Continued .................................................................................. 25
References ............................................................................................................................................... 47

Version: 10.20.2023 Copyright 2023 Microsoft 2 | Page


Maintained by: Microsoft Corporation
Introduction
This is lab two out of five labs in total. Please continue to use your file after completing Lab 1. If you are
joining the DIAD at this point or were unable to complete Lab 1, please start this lab with the “Lab 1
solution.pbix” file you can find in the Reports folder.

In this lab you will learn how to:


• create a range of different charts.
• highlight and cross-filter.
• create new groups and hierarchies.
• add new measures to the model to do additional analysis.

The lab includes steps for the user to follow along with associated screenshots that provide a visual aid. In
the screenshots, sections are highlighted with red or orange boxes to indicate the area the user needs to
focus on.

Note: This lab uses real, anonymized data provided by ObviEnce, LLC. Visit their
site to learn about their services. This data is the property of ObviEnce, LLC and
has been shared to demonstrate Power BI functionality with industry sample
data. Any use of this data must include this attribution to ObviEnce, LLC.

Version: 10.20.2023 Copyright 2023 Microsoft 3 | Page


Maintained by: Microsoft Corporation
Power BI Desktop – Data Modeling and Exploration
In this section, we will learn about the key parts of the Power BI desktop. We will model and explore the
data and build visuals.

Power BI Desktop - Layout


Let’s start with the main Power BI Desktop window of your file entitled MyFirstPowerBIModel (This is the
file that we saved at the end of Lab 1; refer back to the Introduction) and become familiar with the distinct
sections available.

1. At the top of the window within the ribbon, you will see the Home tab where the most common
operations you perform are available.
2. The Insert tab in the ribbon allows you to insert shapes, a text box or new visuals.
3. The Modeling tab in the ribbon enables additional data modeling capabilities like adding custom
columns and calculating measures.
4. The View tab has options to format the page layout.
5. The Help tab provides self-help options like guided learning, training videos and links to online
communities, partner showcases and consulting services.
6. On the left side of the window, you have three icons within the Navigation menu: Report View, Table
View and Model View. If you hover over the icons, you can see the tooltips. Switching between these
allow you to see the data and the relationships between the tables.
7. The center white space is the canvas where you will be creating visuals.

Version: 10.20.2023 Copyright 2023 Microsoft 4 | Page


Maintained by: Microsoft Corporation
8. The Visualizations pane on the right-side of the window allows you to select visualizations, add values
to the visuals, and add columns to the axis or filters.
9. The Data pane is where you see the list of tables which were generated from the queries. By selecting
the arrow next to a table name, you can expand the list of fields for that table.

10. Select the Table view icon within the Navigation menu to the left side of the screen. Select and
expand the Sales table within the Data pane as shown in the figure below. Scroll up and down to
notice how fast you can navigate through over three million rows.

Version: 10.20.2023 Copyright 2023 Microsoft 5 | Page


Maintained by: Microsoft Corporation
11. Select the Model view icon within the Navigation menu to the left side of the screen. You will see the
tables you have imported along with Relationships. The Power BI Desktop can often automatically
infer relationships between the tables.
• A relationship is created between the Sales and Product tables using the ProductID column.
• A relationship is created between the Product and Manufacturer tables using the ManufacturerID
column.
Power BI supports multiple types of relationships:
• 1 to many
• 1 to 1
• Many to many

Version: 10.20.2023 Copyright 2023 Microsoft 6 | Page


Maintained by: Microsoft Corporation
In this lab, we will be using the 1 to many type of relationship, the most common type of relationship. This
means one of the tables involved in the relationship should have a unique set of values. We will create
additional relationships later in this lab.

Drag, resize, and move the tables to appear similar to those shown in the figure below:

Note: Tables may not appear as shown in the figure. You can zoom in and out of the Relationship models
by dragging the zoom slider in the bottom right corner of the window. Also, if you want to ensure you are
seeing all the tables, use the Fit to Screen icon. You can resize the tables by selecting the boarders of
the tables and dragging.

Version: 10.20.2023 Copyright 2023 Microsoft 7 | Page


Maintained by: Microsoft Corporation
Power BI Desktop – Data Exploration
Now that we have loaded data, let’s start with analyzing sales by country.
Ensure that you are currently viewing the report you created and titled MyFirstPowerBIModel in the
previous lab.

1. Select the Report view icon from the Navigation menu to the left side of the Power BI Desktop.
2. Select the Clustered column chart visual from the Visualizations pane.

3. From the Data pane to the right of the screen, expand the Geography table and then select the
checkbox next to the Country field. Notice that the Country field is placed within the X-axis box within
the Visualizations pane.
4. From the Data pane again, expand the Sales table and then select the checkbox next to the Revenue
field. Notice that the Revenue field is placed within the Y-axis box within the Visualizations pane.
5. Resize the visual as needed by dragging the anchor points around the edges of the visual as shown
below.

Version: 10.20.2023 Copyright 2023 Microsoft 8 | Page


Maintained by: Microsoft Corporation
Notice that the Sum of Revenue of each country is the same. This is because there is currently no
relationship between the tables used in the visual.

Next, we will create a relationship between the Sales and Geography tables.

6. Select the Model icon within the Navigation menu to the left side of the Power BI Desktop to navigate
to the Model view.
7. Our sales data is by Zip code, so we need to connect the Zip column from the Sales table with Zip
column in the Geography table. To do this, select, drag, and drop the Zip field in the Sales table to on
top of the Zip field in the Geography table.
You will notice the Create relationship dialog opens with a warning message at the bottom stating the
relationship has a many-many cardinality. The reason for the warning is that we don’t have unique Zip
values in the Geography table. This is because multiple countries could have the same Zip code. Let’s
concatenate the Zip and Country columns to create a unique value field.
8. Select the Cancel button at the bottom of the Create relationship dialog box.

Version: 10.20.2023 Copyright 2023 Microsoft 9 | Page


Maintained by: Microsoft Corporation
We need to create a new column in both the Geography table and the Sales table that combines the Zip
and Country columns. Let’s start by creating a new column in the Sales table.

9. Select the Report icon from the Navigation menu to the left of the screen to navigate to the Report
view.
10. Within the Data pane, hover over the Sales table name, then select the ellipses (…) to the right of the
table name. Choose New Column from the options menu. You will then see a formula bar appear, as
shown in the figure below, to help create this new column.

11. Now we are ready to combine the Zip and Country columns into a new column called ZipCountry,
separated by a comma. To create this column called ZipCountry, type the following calculation in the
formula bar:

ZipCountry = Sales[Zip] & "," & Sales[Country]

12. Once you are done entering the formula in the formula bar, press Enter IMPORTANT!
on your keyboard or select the checkmark on the left side of the
formula bar. If you get an error
You will notice that IntelliSense appears guiding you to choose the correct creating a new column,
column. The language you used to create this new column is called Data make sure your Zip
column is the Text Data
Analysis Expression (DAX). We are connecting columns (Zip and Country) in
Type.
each row by using the “&” symbol. The icon with an (fx), near the new
column ZipCountry, indicates that you have a column containing an If you still have
expression, also referred to as a calculated column. problems, ask!

Version: 10.20.2023 Copyright 2023 Microsoft 10 | Page


Maintained by: Microsoft Corporation
Note: An alternative way to add a new column is by selecting the table from the Data pane, selecting
the Table Tools or Modeling tab, and then choosing New Column from the menu.

Let’s use this method to create a ZipCountry column in the Geography table.

13. From the Data pane, select the Geography table. Then from the ribbon, choose Modeling, and then
select New Column as shown in the figure below:
14. A formula bar now appears. Enter the following DAX expression in the formula bar:

ZipCountry = Geography[Zip] & "," & Geography[Country]

You will see a new column, ZipCountry, in the Geography table. The final step is to set up the relationship
between the two tables using the newly created ZipCountry columns in each of these tables.

15. Select the Model icon in the Navigation menu to the left of the Power BI Desktop to navigate back to
the Model view.

Version: 10.20.2023 Copyright 2023 Microsoft 11 | Page


Maintained by: Microsoft Corporation
16. Drag and drop the ZipCountry field from the Sales table to on top of the ZipCountry field in the
Geography table.

Note: If you do not see the ZipCountry column you may need to scroll down on the list of columns
in each table.

Now we have successfully created a relationship. The number “1” next to Geography indicates it is on the
one side of the relationship and the “*” next to Sales indicates it is on the many side of the relationship.

17. Select the Report icon within the Navigation menu to the left of the Power BI Desktop to navigate
back to the Report view.

Notice the clustered column chart that we created earlier. It shows different sales for each country or
region. USA has the most sales, followed by Australia and Japan.

Note: If your clustered column chart is missing countries then you may need to double check that you
completed step 99 on lab 1 correctly.

By default, the chart is sorted by Revenue. In this next section we will begin to use the data model we
have designed by exploring several data visualization components.

18. Select the Clustered Column Chart visual. Select the ellipses (…) located near the top right corner of
the visual (alternatively, the ellipse may be at the bottom of the chart). Notice there is an option to

Version: 10.20.2023 Copyright 2023 Microsoft 12 | Page


Maintained by: Microsoft Corporation
Sort axis by Country. Do not make any changes for now. Select the background of the report to close
out the options menu.

19. Select the Clustered column Chart again. Then, from the Data pane, expand the Manufacturer table,
and then drag and drop the Manufacturer column to the Legend section of the Visualizations pane.

Version: 10.20.2023 Copyright 2023 Microsoft 13 | Page


Maintained by: Microsoft Corporation
20. Resize the visual as needed within the canvas.
Now we can see the top manufacturers by country.

Now let’s try different visuals to see which chart represents the data the best.

21. With the Clustered column Chart visual selected in the design space, select and change the chart to a
Stacked column chart by choosing the visual type within the Visualizations pane.

22. Sort the legend in descending order using the same method you learned previously (selecting the
ellipsis in the corner of the visual).

Version: 10.20.2023 Copyright 2023 Microsoft 14 | Page


Maintained by: Microsoft Corporation
23. If the Filters pane is not yet expanded, select the << at the top of the collapsed pane to expand it.
Within the Filters pane, expand Manufacturer under the Filters on this visual section. A drop-down
arrow will appear for you to expand when you hover your mouse over Manufacturer.
24. Using the Filter type dropdown menu, select Top N.
25. Enter 5 in the text box next to Top.
26. From the Sales table, drag and drop the Revenue field into the By value section.
27. Select Apply filter at the bottom of the Manufacturer section within the Filters pane to activate the
filter.

Notice that the visual is filtered to display the top five manufacturers by Sum of Revenue. We see that the
manufacturer VanArsdel has a higher percentage of sales in Australia compared to other countries or
regions.
If you desire, you can now collapse the Filters pane until it is needed.
We can now add total labels to the stacked visuals. Let’s explore font formatting options.

28. Select the Format visual (the paintbursh icon) tab at the top of the Visualizations pane, and then
expand the X -axis section.
29. Select the Bold and Italic options – feel free to try different formatting options in different areas. For
the purpose of this lab, we will turn on Bold and Italic.

Version: 10.20.2023 Copyright 2023 Microsoft 15 | Page


Maintained by: Microsoft Corporation
30. Navigate to the Total labels section within the Visualizations pane and switch the setting to On.

Notice the total labels now appearing above each of the columns within the Stacked column chart. Any of
these properties can very easily be changed or turned on/off whenever you like.

Now let’s remove the total labels.

31. Select the On/Off toggle setting next to Total labels to switch the setting to Off again.

We are interested in the top five competitors by revenue. Let’s group them so we don’t have to add a
filter to every visual. Before we do that, we’ll remove the Top 5 visual level filter we added earlier.

32. Begin with the Stacked column chart selected in the canvas.

Version: 10.20.2023 Copyright 2023 Microsoft 16 | Page


Maintained by: Microsoft Corporation
33. Hover over and select the Clear filter icon (eraser) next to the Manufacturer field in the Filters pane.
(You may need to expand the Filters pane if you previously collapsed it)

Note: You will only see the eraser icon when you hover your mouse over the
Manufacturer filter section.

34. From the Data pane, expand the Manufacturer table and right-click on the Manufacturer field.

Note: Do not select the checkbox.

35. Select New Group from the options menu.

Version: 10.20.2023 Copyright 2023 Microsoft 17 | Page


Maintained by: Microsoft Corporation
36. In the Ungrouped values section of the Groups dialog, using the CTRL key (to multi-select), choose
Aliqui, Currus, Natura, and Pirum.
37. Select the Group button. Notice a new group is added in the Groups and members section.
38. Double-click the newly created group and rename it Top Competitors.
39. Select VanArsdel from the Ungrouped values section and select the Group button to create the
VanArsdel group.
40. Select the checkbox Include Other group. This will create another Other group that includes all the
other manufacturers.
41. Select OK to close the Groups dialog.

42. Navigate back to the Build visual tab of the Visualizations pane. With the Stacked column chart
selected in the canvas, select the X next to Manufacturer in the Legend section of the Visualizations
pane. This will remove the Manufacturer field from the Legend.

Version: 10.20.2023 Copyright 2023 Microsoft 18 | Page


Maintained by: Microsoft Corporation
43. From the Data pane, drag and drop the newly created Manufacturer (groups) to the Legend section of
the Visualizations pane. Now we can see that VanArsdel has nearly 50% share in Australia.

Note: It is ok if you notice that the colors used in your column chart are in a different order than
what appears here. This can be adjusted by changed the Legend sort order as you saw in step
34.

44. Hover over one of the columns in the Stacked Column Chart and right-click.
45. Select Show as a table from the context menu. You will now be in Focus mode with the chart
displayed on top and the data displayed below. Notice that VanArsdel has a large percent of the
Australian market.

Version: 10.20.2023 Copyright 2023 Microsoft 19 | Page


Maintained by: Microsoft Corporation
46. Use the orientation icon in the top right corner of the chart to switch to the vertical layout. In this
layout, you view the chart on the left and the data on the right in two separate panels.
47. Switch back to the horizontal layout and select Back to Report to navigate back to the Report canvas.

Note: You can similarly right-click on a column in the chart and select Show data point as a
table to see records for a specific data point.

Now let’s create a Revenue by Manufacturer visual.

48. Select the white space in the canvas to deselect the Stacked column chart visual. From the Data pane,
select the checkbox next to the Revenue field in the Sales table.
49. From the Data pane, select the checkbox next to the Manufacturer field in the Manufacturer table.
50. From the Visualizations pane, select the Treemap visual.

Version: 10.20.2023 Copyright 2023 Microsoft 20 | Page


Maintained by: Microsoft Corporation
We now have Sum of Revenue by Manufacturer.
Let’s turn our attention to the interaction between the Stacked Column Chart and the Treemap visuals.

51. Within the Treemap visual, select VanArsdel and notice that the Stacked column chart is highlighting
only the values related to VanArsdel. This confirms that VanArsdel has a large percentage of the
Australian market.

52. To remove the highlighting, select VanArsdel again.


This interaction between visuals is called cross-highlighting.

Previously, we added a Top 5 Visual level filter. Now let’s add a filter to the Page level, so we are working
with the Top Competitors and VanArsdel, and so we can filter out the other manufacturers.
Page-level filters apply to all visuals on the page. Visual-level filters apply only to the visual. Ensure the
Filters pane is expanded/open.

53. Ensure that the Treemap visual is still selected. From the Data pane, drag and drop Manufacturer
(groups) from the Manufacturer table to the Filters on this page box in the Filters pane.
54. Select both Top Competitors and VanArsdel.

Version: 10.20.2023 Copyright 2023 Microsoft 21 | Page


Maintained by: Microsoft Corporation
Now, let’s add a visual that provides sales information over time.

55. Begin by selecting the white space in the canvas to ensure that nothing is selected.
56. Select the checkbox next to the Date field in the Sales table. Notice that a Date Hierarchy is created if
you have Auto date/time turned on.

Note: If you do not see the data hierarchy go to File -> Options and settings -> Options ->
Current file -> Data load -> Auto date/time) to turn it on.

57. Select the checkbox next to the Revenue field in the Sales table.
58. Change the newly created visual to a Clustered column chart. Notice in the X-axis section, a date
hierarchy is used. There are arrows on the visual header which are used to navigate through the
hierarchy.

We have already noticed that VanArsdel has a large share of the market in Australia. Let’s see how
VanArsdel has done over time in Australia.

59. Select the Sum of Revenue by Country and Manufacturer (groups) chart and remove Manufacturer
(groups) from the legend within the Visualizations pane by selecting the X.
60. Select VanArsdel in the Sum of Revenue by Manufacturer visual (Treemap).

Version: 10.20.2023 Copyright 2023 Microsoft 22 | Page


Maintained by: Microsoft Corporation
61. Then hold the CTRL key (to multi-select) and select Australia within the Sum of Revenue by Country
visual. This will multi-select and highlight both values.

With both VanArsdel and Australia selected we can see a spike in 2021 sales for VanArsdel in Australia.
This spike in sales is intriguing, so let’s investigate further.

62. Hover over the Sum of Revenue by Year visual. Select the down arrow at the top of the Sum of
Revenue by Year visual to enable the drill-down capability.

Version: 10.20.2023 Copyright 2023 Microsoft 23 | Page


Maintained by: Microsoft Corporation
63. Select the 2021 column within the Sum of Revenue by Year visual.
Notice that you have drilled down to the quarter level of 2021. There was a big spike in the fourth
quarter. Let’s dig further.

64. Select the double down-arrow icon at the top of the Sum of Revenue by Year and Quarter visual. This
drills down to the next level of the hierarchy, which is the month level.

65. Select the up-arrow icon at the top of the Sum of Revenue by Month visual to drill back up to the
Quarter level again.
66. Select the drill up icon a second time to go all the way back up to the Year level.
67. Select the split arrow icon at the top of the Sum of Revenue by Year visual. This expands down to the
next level of the hierarchy, which is quarters for all the years; not just 2021. Resize the visual as
needed.

Version: 10.20.2023 Copyright 2023 Microsoft 24 | Page


Maintained by: Microsoft Corporation
Notice that the fourth-quarter sales have always been high, but in 2021 there was a larger sales spike in
the fourth quarter than usual.

68. Now let’s expand down one more time to the month level. Select the split arrow icon for the Sum of
Revenue by Year and Quarter visual again. This drills down to the next level of the hierarchy; this now
shows revenue for months for all the years.

Power BI Desktop – Data Exploration Continued


Now that we’ve explored the data, let’s add a slicer so we can filter by the manufacturers.

69. Start by ensuring there are no filtered or highlighted values. To ensure no values are currently selected
in your report visuals select the blank space of the Sum of Revenue by Country visual. This will clear
any currently selected values.
70. Select the white space in the canvas. From the Data pane, select the checkbox next to the
Manufacturer field in the Manufacturer table.
71. From the Visualizations pane, select the Slicer visual.

Version: 10.20.2023 Copyright 2023 Microsoft 25 | Page


Maintained by: Microsoft Corporation
72. Here you will see a list of Manufacturers. Select VanArsdel and notice that all the visuals are filtered
based on your selection. Also, re-select Australia in the Sum of Revenue by Country visual.

73. With the Slicer visual still selected, navigate to the Format visual tab of the Visualizations pane.
Expand the Slicer settings menu. Then, expand the Options menu within the Slicer settings.
74. Select the drop-down for the Style section within the Options menu. From the drop-down, select
Dropdown.
75. Then, within the Slicer visual, select VanArsdel from the Manufacturer dropdown.

Version: 10.20.2023 Copyright 2023 Microsoft 26 | Page


Maintained by: Microsoft Corporation
76. Confirm Top Competitors and VanArsdel are still selected in the Manufacturer (groups) filter in the
Filters pane.

Note: There is a box for Filters on all pages in the Filters pane. If you have more than one
report page, this is how you sync a filter for the whole file.

Now let’s use the Manufacturer slicer to analyze one manufacturer at a time.

77. First, de-select the Australia column within the Sum of Revenue by Country visual so the report is no
longer filtered by country.
78. Next, select the Sum of Revenue by Manufacturer (Treemap) visual.
79. From the Visualizations pane, select the Card visual.

Version: 10.20.2023 Copyright 2023 Microsoft 27 | Page


Maintained by: Microsoft Corporation
The card visual gives us the Sum of Revenue as we filter and cross-filter the visuals.

Notice that all key dimensions are in tables with related attributes, except for the date. For example,
Product attributes are in the Product table. Manufacturer attributes are in the Manufacturer table. Now
let’s create a Date table.

80. Navigate to the Table view by selecting the Table icon within the Navigation menu to the left of Power
BI Desktop.
81. From the ribbon at the top of the screen, select the Table Tools tab, then choose New Table from the
menu at the top of the screen.

Notice that a new table called “Table” is created in the Data pane to the right of the Power BI Desktop and
the formula bar opens at the top of your screen.
82. Enter the following formula in the formula bar, then hit Enter on your keyboard:
Date = CALENDAR(DATE(2014,1,1), DATE(2022,12,31))
A Date table with a Date column is created.

Version: 10.20.2023 Copyright 2023 Microsoft 28 | Page


Maintained by: Microsoft Corporation
We are using two DAX functions: the CALENDAR function, which accepts the start and end data, and the
DATE function, which takes the year, month, and date Fields.

For this lab, we will create dates from 2014 to 2021 (since we have data for those years). We can also add
more Fields - such as Year, Month, Week, etc. - to this table by using additional DAX functions.

83. Within the Data pane to the right of the screen, select the Date field in the Date table.

Notice that the Date field is of the data type Date/Time. Let’s change it to the Date data type.
84. From the ribbon, select the Column Tools tab, choose the Data type drop-down, and then select Date.

Version: 10.20.2023 Copyright 2023 Microsoft 29 | Page


Maintained by: Microsoft Corporation
Next, we need to create a relationship between the newly created Date table and the Sales table.

85. From the ribbon, select the Column Tools tab, and then choose Manage Relationships.
86. A Manage Relationships dialog box opens. Select the New button.

87. A Create Relationship dialog box opens. Select Date from the top dropdown menu.
88. Select Sales from the second dropdown menu.
89. Highlight the Date field in both tables by multi-selecting (using your Ctrl key on your keyboard).
90. Then, select OK to close the Create relationship dialog box.

Version: 10.20.2023 Copyright 2023 Microsoft 30 | Page


Maintained by: Microsoft Corporation
91. Select the Close button to close the Manage relationships dialog box.
92. Navigate to the Report view by selecting the Report icon within the Navigation menu to the left of the
Power BI Desktop.

Notice that the Sum of Revenue by Date chart looks different now. Let’s fix it.

93. Select the Sum of Revenue by Date visual.


94. From the X-axis section within the Visualizations pane, select the X to remove the Date field.

Version: 10.20.2023 Copyright 2023 Microsoft 31 | Page


Maintained by: Microsoft Corporation
95. From the Data pane, expand the Date table.
96. Now, drag and drop the Date field from the Date table to the X-axis section within the Visualizations
pane.
97. Select the Drill up button above the visual, that you learned about previously, until the visual appears
to be at the Year level.

Notice that the new Date field behavior is like it was previously.

Since there are now two Date fields, it may be confusing to know which one to use. To accommodate this,
let’s hide the Date field in the Sales table.
98. From the Data pane, hover over and select the ellipses (…) to the right of the Date field in the Sales
table. Then, select Hide from the options menu.

Version: 10.20.2023 Copyright 2023 Microsoft 32 | Page


Maintained by: Microsoft Corporation
99. Using the same process as in the previous step, hide Country, ProductID, Zip, and ZipCountry within
the Sales table as well. All that should remain within the Sales table is the Revenue and Units fields.
100. Next, hide ZipCountry from the Geography table.
101. Then, hide ManufacturerID from the Manufacturer table.
102. Hide ProductID and ManufacturerID from the Product table.

Tip: It is a best practice to hide fields that are not used in your report visuals. These fields are
the basis of our relationships between each table so we should not delete them.

Now let’s get back to our data story, Australia, VanArsdel and 2021. Let’s check if the spike occurred in a
specific region in Australia.

103. Select the Sum of Revenue by Country visual.


104. From the Data pane, drag and drop the State field from the Geography table below the Country field
within the X-axis section of the Visualizations pane.

105. Drag and drop the District field from the Geography table below the State field in the X-axis section
of the Visualizations pane.

Version: 10.20.2023 Copyright 2023 Microsoft 33 | Page


Maintained by: Microsoft Corporation
We have just created a hierarchy.

106. Select the up arrow within the header area of the visual twice to Drill up to the top level of the
hierarchy again.

107. Ensure that VanArsdel is still selected within the Manufacturer slicer.
108. Enable Drill down mode by selecting the down arrow of the Sum of Revenue by Country visual once.

109. Select Australia to drill down to the State level.


110. From the Sum of Revenue by Year visual, select 2021 and notice what happens to the Sum of
Revenue by Country.

Tip: If you notice this step performs a drilldown into a table of data select Back to report and
then Data / Drill and disable Data point table in the ribbon.

111. Now, Drill up to the Country level again.


112. Select 2021 again in the Sum of Revenue by Year visual to undo the cross-highlighting.
113. Disable drill mode by selecting the down arrow again on the Sum of Revenue by Country visual.

Version: 10.20.2023 Copyright 2023 Microsoft 34 | Page


Maintained by: Microsoft Corporation
Now let’s analyze the data by product. We’ll start by creating a product hierarchy.

114. Ensure that no visuals are selected within the design canvas. From the Data pane, select the ellipses
(…) to the right of the Category field in the Product table.
115. Select Create Hierarchy.

Notice that a new object called Category Hierarchy is created inside the Product table.

116. Double-click Category Hierarchy and rename it to Product Hierarchy.


117. Select the ellipses (…) to the right of the Segment field within the Product table.
118. Select Add to Hierarchy, and then choose Product Hierarchy.

Version: 10.20.2023 Copyright 2023 Microsoft 35 | Page


Maintained by: Microsoft Corporation
119. Using the same steps, add the Product field from the Product table to the Product Hierarchy. We
have now created a Product Hierarchy with the fields Category, Segment, and Product.

120. Select the white space within the canvas de-select any visual that may be selected. From the
Visualizations pane, select Clustered bar chart.

121. With the Clustered bar chart still selected, from the Data pane, expand the Product table.
122. Select the checkbox to the left of the Product Hierarchy. Notice the complete hierarchy is selected.
123. From the Data pane, expand the Sales table.

Version: 10.20.2023 Copyright 2023 Microsoft 36 | Page


Maintained by: Microsoft Corporation
124. Select the checkbox to the left of the Revenue field.

Notice that the Product Hierarchy is added to the Y-axis field and Sum of Revenue is added to the X-
axis field within the Visualizations pane. You will see the visual within the canvas change and update as
you select these different fields.

Now let’s add a Matrix visual so we can view the data in rows and columns. We can apply conditional
formatting to the matrix visual to highlight the outliers.

125. Select the Sum of Revenue by Category Clustered bar chart and change it to a Matrix visual.

Version: 10.20.2023 Copyright 2023 Microsoft 37 | Page


Maintained by: Microsoft Corporation
126. Select the + (plus sign) to the left of the Urban row to drill down.

Let’s add the percentage of the total field to the visual to give us a better perspective on the data.

127. With the Matrix selected, navigate to the Data pane.


128. From the Data pane, drag and drop the Revenue field from the Sales table to below the existing Sum
of Revenue field in the Values section of the Visualizations pane. It will look like you have Sum of
Revenue twice in the Values section.

Version: 10.20.2023 Copyright 2023 Microsoft 38 | Page


Maintained by: Microsoft Corporation
129. Select the down arrow to the right of the newly added Sum of Revenue field in the Values section.
130. From the visual field menu, hover over Show value as and then select Percent of grand total.

131. Right-click on the newly created field and select Rename for this visual. Name the field %GT
Revenue.
132. Drill back up to Category level if you are not already there within the Matrix visual.

133. Then, select Enable drill down mode within the header of the Matrix visual

Version: 10.20.2023 Copyright 2023 Microsoft 39 | Page


Maintained by: Microsoft Corporation
134. Now, select Urban (the word, not the + sign)

135. Ensure that the Matrix visual is still selected. Then, using the Ctrl key on your keyboard, multi-select
the 2021 column within the Sum of Revenue by Year visual and the Australia column within the Sum
of Revenue by Country visual.

Now let’s look at the Extreme category for Australia over time.
Notice that the Extreme segment has around 40% of the grand total.

Version: 10.20.2023 Copyright 2023 Microsoft 40 | Page


Maintained by: Microsoft Corporation
Now let’s drill down into the Extreme Segment to determine if a Product stands out.

136. Within the Matrix visual, select the Extreme row (the word, not the + sign) to drill down to the
Product level.
137. Resize the visual as needed.

138. Select the ellipses (…) in the top right corner of the matrix visual header.
139. Select Sort By > %GT Revenue and ensure that Sort Descending is also selected (this should be the
default).

Version: 10.20.2023 Copyright 2023 Microsoft 41 | Page


Maintained by: Microsoft Corporation
We can now see the top Products.

140. Ensure 2021 is selected in the Sum of Revenue by Year visual, and Australia in the Sum of Revenue
by Country visual. Notice that Maximus UE-04 and Maximus UE-21 are the top products. Also, notice
that Product Maximus UE-04 has nearly 7% of the grand total.

Earlier we created a calculated column named ZipCountry using DAX. Now let’s create a Percent Growth
calculated measure so we can compare sales over time. We are going to do this in two steps.

But first, what’s the difference between a measure and a calculated column?
• A Calculated column is evaluated row by row. We extend a table by adding calculated columns.
• A Measure is used when we want to aggregate values from many rows in a table.

141. Within the Data pane, select the Sales table.


142. From the ribbon at the top of the screen, select the Table Tools tab, then select New Measure. A
formula bar will appear.
143. Enter PY Sales = CALCULATE(SUM(Sales[Revenue]), SAMEPERIODLASTYEAR('Date'[Date]))

Version: 10.20.2023 Copyright 2023 Microsoft 42 | Page


Maintained by: Microsoft Corporation
144. Select the checkmark to the left of the formula bar or hit Enter on your keyboard. You will see the PY
Sales measure is created within the Sales table.

Let’s create another measure using a different method.

145. In the Data pane, hover over the Sales table.


146. Select the ellipses (…) to the right of the table name.
147. Select New Measure from the options menu. A formula bar opens.

Version: 10.20.2023 Copyright 2023 Microsoft 43 | Page


Maintained by: Microsoft Corporation
148. Within the formula bar, enter the following formula:

% Growth = DIVIDE(SUM(Sales[Revenue])-[PY Sales],[PY Sales])


149. Select the checkmark next to the formula bar or hit Enter on your keyboard. You will see the %
Growth measure added to the Sales table.

150. Ensure that the Matrix visual is still selected. If not, select the Matrix visual and also ensure that you
still have the Australia and 2021 columns selected in the other visuals.
151. In the Data pane, select the checkbox next to the newly created PY Sales and % Growth measures
within the Sales table. These measures should be added to the Values section of the Matrix.
152. Resize the Matrix to see these newly added fields. (You may also have to adjust the size of the other
visuals where needed)

Version: 10.20.2023 Copyright 2023 Microsoft 44 | Page


Maintained by: Microsoft Corporation
Notice that the fields need to be formatted.

153. From the Data pane, select the % Growth field (the name, not the checkbox) within the Sales table.
154. From the ribbon at the top of the screen, select the Measure Tools tab, choose the Format drop-
down, and then select Percentage.

Tip: If your % Growth calculated measures shows as 0.00% at any point, double check that you
still have 2021 and Australia selected as filters from the other visuals.

155. Similarly, from the Data pane, select the PY Sales field (the name, not the checkbox) within the Sales
table.
156. From the ribbon at the top of the screen, select the Measure Tools tab, choose the Format drop-
down, and then select Currency (if it isn’t already formatted to Currency).
157. Then, from the Data pane, select the Revenue field within the Sales table.
158. Using the same process, choose the Format drop-down under the Table tools tab, and then select
Currency (if it isn’t already formatted to Currency).

Version: 10.20.2023 Copyright 2023 Microsoft 45 | Page


Maintained by: Microsoft Corporation
159. Ensure that Australia is still selected within the Sum of Revenue by Country visual, and the 2021
column is still selected within the Sum of Revenue by Year visual. Notice that Maximus UE-04 has
nearly 158% growth compared to last year.

160. Select the white space within the canvas to deselect any of the possible selected visuals. Then, from
the ribbon at the top of the screen, select File and choose Save from the menu to the left of the
screen.

Congratulations! You have now completed Lab 2!

Version: 10.20.2023 Copyright 2023 Microsoft 46 | Page


Maintained by: Microsoft Corporation
References
Dashboard in a Day introduces you to some of the key functions available in Power BI. In the ribbon of the
Power BI Desktop, the Help section has links to some great resources.

Here are a few more resources that will help you with your next steps with Power BI.
• Getting started: http://powerbi.com
• Power BI Desktop: https://powerbi.microsoft.com/desktop
• Power BI Mobile: https://powerbi.microsoft.com/mobile
• Community site https://community.powerbi.com/
• Power BI Getting started support page:
https://support.powerbi.com/knowledgebase/articles/430814-get-started-with-power-bi
• Support site https://support.powerbi.com/
• Feature requests https://ideas.powerbi.com/forums/265200-power-bi-ideas
• New ideas for using Power BI https://aka.ms/PBI_Comm_Ideas
• Power BI Courses http://aka.ms/pbi-create-reports
• Power Platform https://powerplatform.microsoft.com/en-us/instructor-led-training/
• Power Apps Business Apps | Microsoft Power Apps
• Power Automate Power Automate | Microsoft Power Platform
• Dataverse What is Microsoft Dataverse? - Power Apps | Microsoft Docs

© 2023 Microsoft Corporation. All rights reserved.


By using this demo/lab, you agree to the following terms:

The technology/functionality described in this demo/lab is provided by Microsoft Corporation for purposes of
obtaining your feedback and to provide you with a learning experience. You may only use the demo/lab to
evaluate such technology features and functionality and provide feedback to Microsoft. You may not use it
for any other purpose. You may not modify, copy, distribute, transmit, display, perform, reproduce, publish,
license, create derivative works from, transfer, or sell this demo/lab or any portion thereof.

Version: 10.20.2023 Copyright 2023 Microsoft 47 | Page


Maintained by: Microsoft Corporation
COPYING OR REPRODUCTION OF THE DEMO/LAB (OR ANY PORTION OF IT) TO ANY OTHER SERVER OR
LOCATION FOR FURTHER REPRODUCTION OR REDISTRIBUTION IS EXPRESSLY PROHIBITED.

THIS DEMO/LAB PROVIDES CERTAIN SOFTWARE TECHNOLOGY/PRODUCT FEATURES AND FUNCTIONALITY,


INCLUDING POTENTIAL NEW FEATURES AND CONCEPTS, IN A SIMULATED ENVIRONMENT WITHOUT
COMPLEX SET-UP OR INSTALLATION FOR THE PURPOSE DESCRIBED ABOVE. THE TECHNOLOGY/CONCEPTS
REPRESENTED IN THIS DEMO/LAB MAY NOT REPRESENT FULL FEATURE FUNCTIONALITY AND MAY NOT
WORK THE WAY A FINAL VERSION MAY WORK. WE ALSO MAY NOT RELEASE A FINAL VERSION OF SUCH
FEATURES OR CONCEPTS. YOUR EXPERIENCE WITH USING SUCH FEATURES AND FUNCITONALITY IN A
PHYSICAL ENVIRONMENT MAY ALSO BE DIFFERENT.

FEEDBACK. If you give feedback about the technology features, functionality and/or concepts described in
this demo/lab to Microsoft, you give to Microsoft, without charge, the right to use, share and commercialize
your feedback in any way and for any purpose. You also give to third parties, without charge, any patent rights
needed for their products, technologies and services to use or interface with any specific parts of a Microsoft
software or service that includes the feedback. You will not give feedback that is subject to a license that
requires Microsoft to license its software or documentation to third parties because we include your feedback
in them. These rights survive this agreement.

MICROSOFT CORPORATION HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS WITH REGARD TO
THE DEMO/LAB, INCLUDING ALL WARRANTIES AND CONDITIONS OF MERCHANTABILITY, WHETHER
EXPRESS, IMPLIED OR STATUTORY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT.
MICROSOFT DOES NOT MAKE ANY ASSURANCES OR REPRESENTATIONS WITH REGARD TO THE ACCURACY
OF THE RESULTS, OUTPUT THAT DERIVES FROM USE OF DEMO/ LAB, OR SUITABILITY OF THE INFORMATION
CONTAINED IN THE DEMO/LAB FOR ANY PURPOSE.

DISCLAIMER

This demo/lab contains only a portion of new features and enhancements in Microsoft Power BI. Some of the
features might change in future releases of the product. In this demo/lab, you will learn about some, but not
all, new features.

Version: 10.20.2023 Copyright 2023 Microsoft 48 | Page


Maintained by: Microsoft Corporation

You might also like