Lab 2 - Data Modeling and Exploration
Lab 2 - Data Modeling and Exploration
Dashboard in a Day
Lab 2
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.
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.
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.
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 like those shown in the figure above:
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.
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.
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.
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.
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:
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!
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:
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
Notice that the Sum of Revenue by Date chart looks different now. Let’s fix it.
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.
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.
105. Drag and drop the District field from the Geography table below the State field in the X-axis section
of the Visualizations pane.
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.
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.
Now let’s analyze the data by product. We’ll start by creating a product hierarchy.
Notice that a new object called Category Hierarchy is created inside the Product table.
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.
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.
Let’s add the percentage of the total field to the visual to give us a better perspective on the data.
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
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.
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).
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.
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)
153. From the Data pane, select the % Growth field (the name, not the checkbox) within the Sales table.
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).
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.
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
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.
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.