Lab 2 - Data Modeling and Exploration A4
Lab 2 - Data Modeling and Exploration A4
Dashboard in a Day
Lab 2
Introduction
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: Error! Hyperlink reference not valid.. 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. On the top of the window, you 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 modelling 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 showcase and consulting services.
6. On the left side of the window, you have three icons, Report, Data and Model. If you hover over the
icons, you can see the tooltips. Switching between these allows you to see the data and the
relationships between the tables.
8. The Visualizations panel on the right allows you to select visualizations, add values to the visuals,
and add columns to the axis or filters.
9. The Fields window on the right panel is where you see the list of tables which were generated from
the queries. Click the icon (downward facing triangle) next to a table name to expand the
field list for that table.
11. Click on the Model icon on the left panel of Power BI Desktop. You see the tables you have
imported along with Relationships. The Power BI Desktop automatically infers 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
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.
Note: Tables may not appear as shown in the figure. You can zoom in and out of the Relationships
page 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: . Drag and move the tables to appear as
shown in the figure:
15. From the Fields section, expand the Geography table and then click the checkbox next to the
Country field.
16. From the Fields section, expand the Sales table and then click the checkbox next to the Revenue
field.
17. Resize the visual as needed by dragging the edges.
18. Click on the Model icon on the left panel to navigate to the Relationship view.
19. 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. You can do this by dragging the Zip field in the Sales table to
connect the line with the Zip field in the Geography table.
23. 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 editor.
ZipCountry = Sales[Zip] & "," & Sales[Country]
Let us use this method to create a ZipCountry column in the Geography table.
25. From the Fields section, click the Geography table, from the ribbon click Modeling, and then click
New Column as shown in the figure.
26. A formula bar now appears. Enter the following DAX expression in the formula bar:
ZipCountry = Geography[Zip] & "," & Geography[Country]
31. Notice that we have some blanks in our data. We want to clean up our data and get rid of the
blanks
32. Drag the Country field from the Geography table to the Filters pane and drop it in Filters on all
pages
33. Change filter type to Advanced filtering and select is not blank, click on Apply Filter
NOTE: Additional filter options are available: is blank, is empty, is not empty
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.
49. Begin with Stacked column chart selected.
50. Hover over and click the Clear filter icon (erase) next to Manufacturer field in the Filters Pane.
59. With the Stacked column chart selected, click on the X next to Manufacturer in the Legend
section. This will remove the Manufacturer.
60. From the Fields section, drag the newly created Manufacturer (groups) to the Legend section.
Now we can see that VanArsdel has nearly 50% share in Australia.
Note: You can use similar steps to Show data point as a table to see records for a specific data point.
We now have Revenue by Manufacturer. Now let’s turn our attention to the interaction between the
Stacked column chart and the Treemap visuals.
68. In the Treemap, click VanArsdel and notice that the Stacked column chart is filtered. This confirms
that VanArsdel has a large percentage of the Australian market.
Now, let’s add a visual that provides sales information over time
72. Begin by clicking on the white space in the canvas.
73. Click the checkbox next to the Date field in the Sales table. Notice that a Date Hierarchy is created.
74. Click the checkbox next to the Revenue in the Sales table field. Notice that a Clustered column
chart is created. Also notice in the Axis section, a date hierarchy is created. There are arrows on the
top bar of the chart which are used to navigate through the hierarchy.
Notice now in both Revenue by Year and Revenue by Manufacturer, data is filtered for Australia
78. Now click the Revenue by Year visual.
79. Next, click the filter icon on the other two visuals.
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.
89. Click on the up-arrow icon on the top of the Revenue by Year visual to drill up to the Quarter level.
90. Click on the drill up icon again to go up to the Year level
There is a lot of information in the visual and we must scroll left and right to compare.
Now that we’ve explored the data, let’s add a slicer so we can filter by the manufacturers.
93. Click on the white space in the canvas. From the Fields section, click the checkbox next to the
Manufacturer field in the Manufacturer table.
94. From the Visualizations section, click on the Slicer visual.
95. Here you will see a list of Manufacturers. Click VanArsdel and notice that all the visuals are filtered
based on your selection.
96. Hover over the top right corner of the visual and click on the down arrow. Notice you have the
option to change the slicer from a list to a dropdown.
97. Click Dropdown.
98. Click VanArsdel from the dropdown.
Note that there is a box for Filters on all pages in the Filters pane. If you have duplicate pages, 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.
100. Begin by clicking on the Revenue by Manufacturer Treemap visual.
101. From the Visualizations section, click on the Card visual.
We are using two DAX functions: the CALENDAR function, which takes 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, like Year, Month, Week, etc., to this table by using DAX functions.
Notice that the Date field is of the type Date/Time. Let’s change it to the Date data type.
105. Click on the Date field in the Date table.
106. From the ribbon, click Column Tools, click Data type, and then click Date.
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.
119. From the Fields section, click on the three dots next to the Date field in the Sales table and select
Hide
169. Click the + (plus sign) next to the Urban row to drill down.
172. Click the arrow next to the newly added Revenue field.
173. From the menu, hover over Show value as and then click Percent of grand total.
177. In the Revenue by Year visual click the 2021 column and click Australia in the Revenue by
Country visual. Notice that the Extreme segment has around 40% of the grand total.
178. In the Revenue by Year visual click the 2021 column to remove the filter.
Now let’s drill down into the Extreme Segment and figure out if a Product stands out.
179. In the matrix visual, click the Extreme row (the word, not the + sign) to drill down to the Product
level.
180. Resize the visual as needed.
181. Hover over the matrix visual and then click the ellipse in the top right corner.
182. Click Sort By %GT Revenue and then click Sort Descending.
184. In the Revenue by Year visual, click the 2021 column to remove the filter.
Earlier we created a calculated column named ZipCountry. Now let’s create a Percent Growth
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.
185. In the Fields section, click the Sales table.
186. From the ribbon, click Table Tools, then click New Measure. A formula bar opens.
187. Enter PY Sales = CALCULATE(SUM(Sales[Revenue]), SAMEPERIODLASTYEAR('Date'[Date]))
188. Click the checkmark next to the formula bar. You will see the PY Sales measure in the Sales table.
Let’s create another measure.
189. In the Fields section, hover over the Sales table.
190. Click on the ellipse in the right corner.
191. Click New Measure from the dialog box. A formula bar opens.
193. Click the checkmark next to the formula bar. You will see % Growth measure in the Sales table.
194. Click the matrix visual.
195. In the Fields section, click the checkbox next to the newly created PY Sales and % Growth
measures in the Sales table.
Notice that the Fields need to be formatted.
196. From the Fields section, click the % Growth field.
197. From the ribbon, click Measure Tools, click Format, and then click Percentage.
198. Similarly, from the Fields section, and then click the PY Sales field.
199. From the ribbon, click Measure Tools, click Format, and then click Currency, if it isn’t already
formatted Currency .
200. Similarly, from the Fields section, and then click the Revenue field.
201. From the ribbon, click Measure Tools, click Format, and then click Currency if it isn’t already
formatted to Currency
202. Ensure that Australia is selected and In the Revenue by Year visual, Ctrl + click the 2021 column.
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
• © 2022 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.
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.
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.