PL300
PL300
Contents
0: Demo setup............................................................................................................ 2
2. Open Microsoft Edge, then navigate to https://powerbi.com and sign in using the instructor
account.
8. In the Power BI service, open the Sales Analysis report, and then pin the column/line chart visual
to create a new dashboard named Sales Monitoring.
10. Open the dashboard and leave it ready for the first demo.
Demo assets can be found in the PL-300 Power BI Data Analyst GitHub Repository.
1: Get Started with Microsoft Data
Analytics
Explore the dashboard
1. Show the Sales Monitoring dashboard, and explain how it can be used to get at-a-glance facts.
4. Edit the report, and then expand all fields in the Fields pane.
5. Explain that the data model is based on a SQL Server database and an Excel workbook, which
helps to determine cost of goods sold.
7. Explain that it will be shared with a recipient, and that recipients will only be allowed to see a
subset of data being only the product categories they manage.
8. Return to the Power BI service home page, and collapse the workspace.
1. Open Power BI Desktop, and then dismiss the getting started page.
4. Connect to the database server name found in the MySettings.txt file, using Windows
authentication.
Preview data
10. Describe the Power Query Editor window layout, including the Queries pane, the Query Settings
pane, the ribbon, the preview grid, and the status bar.
11. Point out the quality bar beneath the column headers and hover the cursor over it to reveal
statistics about the column values.
13. Turn on Column Distribution and point out columns like ProductID (unique values) and
ProductCategory (several duplicate values).
14. Turn on Column Profile, and then select the ProductCategory column.
17. Save the Power BI Desktop file, but do not apply changes.
18. Leave the Power BI Desktop file open for the next demo.
3: Clean, Transform, and Load Data in
Power BI
Apply query transformations
• ProductSKU to SKU
• ProductName to Product
• ProductCategory to Category
• OrderDate
• ProductID
• Quantity
• UnitPrice
7. Change the data type of the UnitPrice column to Fixed Decimal Number.
9. Multi-select the Quantity and Unit Price columns, and then add a new column based on their
multiplication.
Integrate queries
11. Create a new query using the Excel connector, connecting to the
D:\PL300\Demo\Data\ProductCost.xlsx file.
13. Change the data type of the ProductCost column to Fixed Decimal Number.
14. Select the Product query, and then merge with the ProductCost query, relating the SKU columns.
15. In the Privacy Levels window, set the privacy level for the D:\ to Organizational.
16. Expand the ProductCost column to include the ProductCost column (from the ProductCost
query).
Disable a query
19. On the Home ribbon tab, click the Close & Apply icon.
20. In Power BI Desktop, point out the two tables in the Fields pane.
22. Leave the Power BI Desktop file open for the next demo.
4: Design a Data Model in Power BI
Review the model
2. In the Sales table, point out the OrderDate hierarchy, which was created automatically.
3. In Model view, hover over the automatically-created relationship between the two tables.
4. Explain how filters will propagate from the Product table to the Sales table.
Create a hierarchy
10. Multi-select the Sales and Unit Price columns, and format them to use two decimal places.
11. In Report view, add a matrix visual to the page, and then size it to fill the entire page.
12. Add the Products hierarchy to the rows, and then add the Quantity, Sales, and Unit Price fields.
14. Point out that the Unit Price values are the sum of prices, which is not correct.
15. In the Fields pane, select the Unit Price field, and configure its summarization to use Average.
16. Remove the Sum of Unit Price column from the matrix visual, and then add the Unit Price field
back again.
18. Leave the Power BI Desktop file open for the next demo.
5: Create Measures using DAX in Power
BI
Create a calculated table
DAX
Date = CALENDARAUTO()
2. Switch to Data view, and review the table, which comprises a single date column.
DAX
Year = "CY" & YEAR('Date'[Date])
DAX
Month = FORMAT('Date'[Date], "YYYY-MM")
5. In Model view, create a relationship by dragging the Date table Date column to the Sales table
OrderDate column.
7. In the Date table, create the Calendar hierarchy, with Year and Month levels.
8. In Report view, mark the Date table as a date table using the Date column.
9. In the matrix visual, remove the Products hierarchy, and then replace it with the Calendar
hierarchy.
DAX
Cost = 'Sales'[Quantity] * RELATED('Product'[Cost])
12. Add a quick measure to the Sales table, subtracting the Cost column from Profit column.
14. Explain that the measure does not store data in the model.
Create regular measures
DAX
Profit Margin = DIVIDE([Profit], SUM('Sales'[Sales]))
DAX
Sales YTD = TOTALYTD(SUM('Sales'[Sales]), 'Date'[Date])
19. Add the Cost, Profit, Profit Margin, and Sales YTD fields to the matrix visual.
21. Leave the Power BI Desktop file open for a later demo.
6: Optimize Model Performance
Review a DirectQuery model design
3. At the bottom-right corner, point out that the data model comprises DirectQuery tables.
5. In Model view, introduce the model design, which includes two related tables.
6. In Report view, interact with the report by selecting different items in the Fiscal Year slicer.
10. Refresh the visuals, and then expand the slicer and Sales by Month visual and point out that they
used DirectQuery mode (data was requested from the data source).
11. In Model view, select the Date table, and then select the storage mode to Dual.
12. When the data has imported, switch to Report view, and then in the Performance Analyzer pane,
refresh the visuals.
13. Point out that the Date table is now queried from the model cache.
Create aggregations
14. Open the Power Query Editor window, and in the Queries pane, duplicate the Reseller Sales
query.
• Group by OrderDate.
18. In Model view, set the storage mode for the Reseller Sales Agg table to Import.
19. Create a relationship from the Date table Date column to the Reseller Sales Agg table
OrderDate column—ensure that the column cardinality is set to one-to-many, with the Date
table on the one-side.
22. Switch to Report view, and in the Performance Analyzer pane, and then refresh the visuals.
23. Point out that the Sales by Month table is now queried from the model cache.
24. Drill through from any month, and point out that the details in the table are requested as
DirectQuery from the data source.
1. Remove the matrix visual that was used to test and validate the model calculations.
Add a slicer
3. Add a slicer for the Date table Year column and position it at the top-left of the report page.
4. Use the formatting options to configure the slicer for single selection.
5. Add a line and stacked column chart to the page, and configure it as follows:
6. Use the slicer to filter the page by CY2019, and then CY2020.
7. In the line and stacked column chart, point out that there is no sales column for December 2020.
9. Point out that December 2020 is added to the axis, but there is no column of data.
10. Explain that sales data for December 2020 has not happened yet.
You will run a script in a later demo to load December 2020 sales.
13. Add a Q&A visual, and enter the following question: Total sales by product demographic
15. Leave the Power BI Desktop file open for a later demo.
8: Perform Data Analysis
Add a group
16. Add another new page to the report named Category Analysis.
17. Copy, paste, and then sync the Year slicer from the Profit Analysis page to the new page.
18. Add a new group based on the Product table Category column.
21. Add a matrix visual, and position and size it so it fills the page.
• Values: Quantity, Sales, Profit, and Profit Margin from the Sales table
24. In the matrix visual, apply background color conditional formatting to the Profit Margin field.
25. Select red for the minimum color, and green for the maximum color.
26. Point out the range of colors used to convey low-to-high profit margin values.
28. Publish the report to the newer workspace, overwriting when prompted.
29. In the Power BI service, open the Sales Analysis report, and interact with each of the report pages.
2. Sign in to the Power BI service, and accept the Power BI Pro trial license if not already done.
Create an app
13. In the Setup section, enter description text and optionally choose a theme color.
14. In the Navigation section, optionally sequence the report before the dashboard.
18. Open Apps, and then get the app you just published.
21. Leave the app open. It will be used in the row-level security demo and lab.
10: Manage Files and Datasets in Power
BI
Prepare for gateway data refresh
Note that the following steps are not needed when using the data gateway in personal mode. You can
proceed directly to the next objective (setup the gateway).
22. In Power BI Desktop, open the Power Query Editor window, and select the ProductCost query.
23. Edit the Source step, and then modify the file path to use the file share, as follows: \\DATA-
AI\Data\ProductCost.xlsx
You can copy the file share path from the MySettings.txt file.
26. Publish the Power BI Desktop file to the workspace, overwriting the dataset and report in the
service.
27. In the Power BI service for the instructor, reload (F5) the dataset settings page.
28. Expand the Gateway Connection section and point out that no gateway is installed.
29. Use the download dropdown list (located at the top-right), and select Data Gateway.
30. In the new web page, download the personal mode gateway.
32. Complete the gateway setup by using the credentials of the instructor account.
33. Once setup, return to and reload the dataset settings page.
34. Assign the personal gateway, and the edit the credentials for the two data sources.
35. For both data sources, set the authentication method to WindowsWithoutImpersonation, and
set the privacy level to Organizational.
36. Optionally, expand the Scheduled Refresh section, and show how to configure a recurring
schedule.
37. Before refreshing the dataset, open the Sales Monitoring dashboard.
38. Edit the details of the Sales, Profit Margin tile to display the last refresh time.
39. Right-click the D:\PL300\Demo\Resources\UpdateDatabase-LoadAdditionalSales.ps1 file, and
then run with PowerShell.
A script will load December 2020 sales data into the database.
40. In the Power BI service for the instructor, from the Navigation pane, refresh the Sales Analysis
dataset.
41. When the refresh completes, point out how the dashboard tile December 2020 column appears,
and that the refresh time is NOW.
11: Create Dashboards
Create a dashboard
1. First, in the Power BI service, create a new workspace, and use the
D:\PL300\Demo\Resources\Icon-Airplane.jpg image as its icon.
2. In Power BI Desktop, publish the Sales Analysis report to the new workspace.
4. Open the Sales Analysis report, and then ensure the Year slicer is set to CY2020.
5. Pin the line and stacked column chart to create a new dashboard named Sales Monitoring.
8. Edit the details of the Profit Margin tile and change the subtitle text to include the year (CY2020).
9. Use Q&A on the dashboard to ask the following question: Total sales in CY2020
1. In Power BI Desktop, open the Power Query Editor window, and add a new query based on the
D:\Demo\Data\ManagerCategory.xlsx file (use the ManagerCategory Excel table).
3. Split the Category column by the semicolon delimiter and split into rows (advanced options).
4. In the Email column, replace the value [email protected] with the recipient account
(from the MySettings.txt file).
5. Point out that this user is able to see three product categories: Collective pitch, Trainer, and
Warbird.
7. In Model view, create a relationship between the ManagerCategory and Product tables relating
the Category columns.
Add a role
10. In Report view, open Manage Roles, and then create a role named Manager.
11. In the role, filter the ManagerCategory table Email address column as follows:
DAX
[Email] = USERPRINCIPALNAME()
13. Open View As, and then configure the following settings:
14. Point out that the filter visual shows just three product categories.
17. Publish the Power BI Desktop file to the workspace, overwriting the dataset and report in the
service.
19. In the Power BI service for the instructor, from the Navigation pane, open the security page for
the Sales Analysis dataset.
20. In the Members section, enter the recipient account (representing Ty Johnston).
23. In the Power BI service for the recipient, refresh the dashboard (left open from the previous demo).
24. In the Profit Margin dashboard tile, verify that only three product categories can be seen.