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.
10. Select the Data 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.
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.
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.
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.
20. Select the Report icon within the Navigation menu to the left of the screen to navigate to the Report
view.
21. 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.
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.
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.
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]
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.
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.
29. 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
Sort axis by Country. Do not make any changes for now. Select the background of the report to close
out the options menu.
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.
35. Using the Filter type dropdown menu, select Top N.
36. Enter 5 in the text box next to Top.
37. From the Sales table, drag and drop the Revenue field into the By value section.
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.
40. 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.
41. 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.
42. 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.
44. From the Data pane, expand the Manufacturer table and right-click on the Manufacturer field.
Note: Do not select the checkbox.
52. 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.
54. Hover over one of the columns in the Stacked Column Chart and right-click.
55. 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.
56. 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.
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
65. Begin by selecting the white space in the canvas to ensure that nothing is selected.
66. 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.
67. Select the checkbox next to the Revenue field in the Sales table.
68. 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.
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.
72. 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.
74. 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.
75. 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.
76. 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.
78. 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.
82. 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.
86. 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.
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.
90. Navigate to the Data view by selecting the Data icon within the Navigation menu to the left of the
Power BI Desktop.
91. 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.
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.
93. Within the Data pane to the right of the screen, select the Date field in the Date table.
Next, we need to create a relationship between the newly created Date table and the Sales table.
95. From the ribbon, select the Column Tools tab, and then choose Manage Relationships.
96. A Manage Relationships dialog box opens. Select the New button.
101. Select the Close button to close the Manage relationships dialog box.
102. 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.
103. Select the Sum of Revenue by Date visual.
Notice that the new Date field behavior is like it was previously.
109. 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.
110. Next, hide ZipCountry from the Geography table.
111. Then, hide ManufacturerID from the Manufacturer table.
112. 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.
113. Select the Sum of Revenue by Country visual.
115. Drag and drop the District field from the Geography table below the State field in the X-axis section
of the Visualizations pane.
127. Select the ellipses (…) to the right of the Segment field within the Product table.
128. Select Add to Hierarchy, and then choose Product Hierarchy.
129. 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.
131. With the Clustered bar chart still selected, from the Data pane, expand the Product table.
132. Select the checkbox to the left of the Product Hierarchy. Notice the complete hierarchy is selected.
133. From the Data pane, expand the Sales table.
134. 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.
136. 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.
137. With the Matrix selected, navigate to the Data pane.
139. Select the down arrow to the right of the newly added Sum of Revenue field in the Values section.
140. From the visual field menu, hover over Show value as and then select Percent of grand total.
141. Right-click on the newly created field and select Rename for this visual. Name the field %GT
Revenue.
143. Then, select Enable drill down mode within the header of the Matrix visual
144. Now, select Urban (the word, not the + sign)
145. 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.
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.
146. Within the Matrix visual, select the Extreme row (the word, not the + sign) to drill down to the
Product level.
147. Resize the visual as needed.
148. Select the ellipses (…) in the top right corner of the matrix visual header.
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.
151. Within the Data pane, select the Sales table.
154. 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.
160. 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.
161. 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.
162. 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.
165. Similarly, from the Data pane, select the PY Sales field (the name, not the checkbox) within the Sales
table.
166. 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).
167. Similarly, from the Data pane, select the Revenue field.
168. 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).
170. 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.