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, Data and
Model. 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.
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
Drag, resize, and move the tables to appear as 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.
14. 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.
15. 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.
16. Resize the visual as needed by dragging the anchor points around the edges of the visual as shown
below.
17. Select the Model icon within the Navigation menu to the left side of the Power BI Desktop to navigate
to the Model view.
18. 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.
19. Select the Cancel button at the bottom of the Create relationship dialog box.
22. 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]
23. 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
creating a new column,
You will notice that IntelliSense appears guiding you to choose the correct make sure your Zip
column. The language you used to create this new column is called Data 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
If you still have
column ZipCountry, indicates that you have a column containing an
problems, ask!
expression, also referred to as a calculated column.
Let’s use this method to create a ZipCountry column in the Geography table.
24. 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:
25. 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.
26. Select the Model icon in the Navigation menu to the left of the Power BI Desktop to navigate back to
the Model view.
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.
28. 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.
30. 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 under Visualizations.
33. Sort the legend in descending order using the same method you learned in step 29.
34. 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.
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.
39. Select the paint brush icon (Format your visual button) at the top of the Visualizations pane, and then
expand the X -axis section.
41. 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.
42. 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.
43. Begin with the Stacked column chart selected in the canvas.
44. 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.
45. From the Data pane, expand the Manufacturer table and right-click on the Manufacturer field.
Note: Do not select the checkbox.
47. In the Ungrouped values section of the Groups dialog, using the CTRL key (to multi-select), choose
Aliqui, Currus, Natura, and Pirum.
48. Select the Group button. Notice a new group is added in the Groups and members section.
49. Double-click the newly created group and rename it Top Competitors.
50. Select VanArsdel from the Ungrouped values section and select the Group button to create the
VanArsdel group.
51. Select the checkbox Include Other group. This will create another Other group that includes all the
other manufacturers.
53. 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. (You may need to switch
to the Add data to your visual tab within the Visualizations pane)
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.
55. Hover over one of the columns in the Stacked Column Chart and right-click.
56. 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.
Now, let’s add a visual that provides sales information over time
66. Begin by selecting the white space in the canvas to ensure that nothing is selected.
67. 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.
68. Select the checkbox next to the Revenue field in the Sales table.
69. 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.
Note: You will not see the Format tab if you do not select the Sum of Revenue by
Country and Manufacturer (groups) visual first.
Notice now in both Sum of Revenue by Year and Sum of Revenue by Manufacturer, data is filtered for
Australia.
Select Australia again to deselect the filter.
73. Now, select the Sum of Revenue by Year visual.
74. Next, select the Filter icon on the other two visuals.
Note: If your screen does not match the figure above, please edit your interactions. If the
colors in the column chart are different that is ok.
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.
78. 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.
79. Select VanArsdel in the Sum of Revenue by Manufacturer visual (Treemap).
We have now filtered the charts by both VanArsdel and Australia. Looking at the results, we can see a
spike in 2021 sales for VanArsdel in Australia. This spike in sales is intriguing, so let’s investigate further.
81. 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.
82. 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.
84. Select the up-arrow icon at the top of the Sum of Revenue by Year visual to drill back up to the
Quarter level again.
85. Select the drill up icon a second time to go all the way back up to the Year level.
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.
87. Now let’s expand down one more time to the month level. Select the split arrow icon at the top right
of the Sum of Revenue by Year and Quarter visual again. This expands down to the next level of the
hierarchy; this shows revenue for months for all the years.
90. 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.
91. With the Slicer visual still selected, navigate to the Format visual section of the Visualizations pane.
Expand the Slicer settings menu. Then, expand the Options menu within the Slicer settings.
92. Select the drop-down for the Style section within the Options menu. From the drop-down, select
Dropdown.
94. 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.
95. First, de-select the highlighted value on Sum of Revenue by Country of Australia so the report is no
longer filtered by country.
96. Next, select the Sum of Revenue by Manufacturer (Treemap) visual.
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.
98. Navigate to the Data view by selecting the Data icon within the Navigation menu to the left of the
Power BI Desktop.
99. 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.
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.
101. 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.
Next, we need to create a relationship between the newly created Date table and the Sales table.
103. From the ribbon, select the Column Tools tab, and then choose Manage Relationships.
104. A Manage Relationships dialog box opens. Select the New button.
105. A Create Relationship dialog box opens. Select Date from the top dropdown menu.
106. Select Sales from the second dropdown menu.
107. Highlight the Date field in both tables by multi-selecting (using your Ctrl key on your keyboard).
109. Select the Close button to close the Manage relationships dialog box.
110. 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.
111. Select the Sum of Revenue by Date visual.
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.
117. 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.
118. Next, hide ZipCountry from the Geography table.
119. Then, hide ManufacturerID from the Manufacturer table.
120. 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.
121. Select the Sum of Revenue by Country visual.
123. Drag and drop the District field from the Geography table below the State field in the X-axis section
of the Visualizations pane.
135. Select the ellipses (…) to the right of the Segment field within the Product table.
136. Select Add to Hierarchy, and then choose Product Hierarchy.
137. Select the ellipses (…) to the right of the Product field within the Product table.
138. Select Add to Hierarchy, and then choose Product Hierarchy.
We have now created a Product Hierarchy with the fields Category, Segment, and Product.
140. With the Clustered bar chart still selected, from the Data pane, expand the Product table.
141. Select the checkbox to the left of the Product Hierarchy. Notice the complete hierarchy is selected.
142. From the Data pane, expand the Sales table.
143. 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.
Note: Review steps 71-72 if you need a review of how Edit interactions works.
146. Do the same thing with the Sum of Revenue by Year visual; select the Sum of Revenue by Year visual
and change the interaction of the Sum of Revenue by Category to filter
147. We also need to change the interactions of the other charts. Select the Sum of Revenue by Category
visual and change the Sum of Revenue by Year visual to a filter action.
148. Select the filter interaction on the Sum of Revenue by Country visual as well.
149. Select the format tab and choose Edit interactions to turn it off.
150. Navigate back to the Sum of Revenue by Category visual
151. Enable drill-down mode in the Sum of Revenue by Category chart by selecting the down arrow in the
visual header.
153. Within the Sum of Revenue by Country visual ensure you are at the Country level. If you are not, drill
up to Country level then disable drill down.
158. Disable drill mode in the Sum of Revenue by Category and Segment visual
159. Ctrl + select the Urban Extreme Segment in the Sum of Revenue by Category and Segment visual.
Notice that there is no significant spike in revenue by State.
164. Select the background of the Sum of Revenue by Year visual to ensure the visual is not still filtered.
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.
165. 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.
167. With the Matrix selected, navigate to the Data pane.
168. 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.
169. Select the down arrow to the right of the newly added Sum of Revenue field in the Values section.
171. Right-click on the newly created field and select Rename for this visual. Name the field %GT
Revenue.
172. Drill back up to Category level if you are not already there within the Matrix visual.
173. Then, select Enable drill down mode within the header of the Matrix visual
174. Now, select Urban (the word, not the + sign)
Now let’s look at the Extreme category for Australia over time.
Notice that the Extreme segment has around 40% of the grand total.
Now let’s drill down into the Extreme Segment to determine if a Product stands out.
176. Within the Matrix visual, select the Extreme row (the word, not the + sign) to drill down to the
Product level.
178. Select the ellipses (…) in the top right corner of the matrix visual header.
179. Select Sort By > %GT Revenue and ensure that Sort Descending is also selected (this should be the
default).
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.
181. Within the Data pane, select the Sales table.
182. From the ribbon at the top of the screen, select the Table Tools tab, then select New Measure. A
formula bar will appear.
183. Enter PY Sales = CALCULATE(SUM(Sales[Revenue]), SAMEPERIODLASTYEAR('Date'[Date]))
190. 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.
191. 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.
192. Resize the Matrix to see these newly added fields. (You may also have to adjust the size of the other
visuals where needed)
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.
195. Similarly, from the Data pane, select the PY Sales field (the name, not the checkbox) within the Sales
table.
196. 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).
197. Similarly, from the Data pane, select the Revenue field.
198. From the ribbon at the top of the screen, select the Column Tools tab, choose the Format drop-
down, and then select Currency (if it isn’t already formatted to Currency).
199. 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.
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.