Download as pdf or txt
Download as pdf or txt
You are on page 1of 99

ONLC Training Centers Excel BI Tools Labs and Reviews

Excel BI Tools Labs and Reviews

Power Pivot, Power Query,


Power Map, and Power BI
Desktop

© 2022 Online Consulting, Inc., Revised 01/07/22 1


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Configuring Excel


1. Open the File Explorer.

Try It 2. Locate the BEBT16 folder on the desktop.

3. Drag the folder BEBT16 into the Favorites on the left as shown below:

4. Select the BEBT16 Data folder under Favorites. In the address bar, click in the
address bar to the right of BEBT16 Data. The location will be highlighted in
blue and will display the full path as below:

5. Right-click the path and click Copy.

6. Close the File Explorer.

7. Start Excel.

8. Click Blank workbook.

9. Select the File tab and click Options.

10. On the General Options screen, clear the check for Show the Start screen when
this application starts.

11. On the Save Options screen, check Don’t show the Backstage when opening or
saving files.

12. Clear the check for Show additional places for saving, even if sign-in may be
required.

13. Check the box for Save to Computer by default.

14. Set the default local file location: C:\Users\Student\Desktop\BEBT16 Data or the
location of the BEBT16 data folder. This can be pasted from the File Explorer.

© 2022 Online Consulting, Inc., Revised 01/07/22 2


ONLC Training Centers Excel BI Tools Labs and Reviews

15. On the Quick Access Toolbar screen, add the following icons:

From the Popular Commands select:


New File
Open
Save
Undo
Redo
Print Preview and Print
Save As

From the All Commands select:


Close File
Go to the Power Pivot window

16. Click OK. Notice the new icons on the Quick Access Toolbar.

© 2022 Online Consulting, Inc., Revised 01/07/22 3


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Installing Power Pivot


1. In Excel, select the File tab and click Options.
Try It
2. Select Add-ins.

3. Open the Manage: drop-down list and select COM (Component Object Model)
Add-ins and click Go.

4. Select Microsoft Power Pivot for Excel, if necessary, and click OK.

5. Select the File tab and click Account. Select About Excel. Note Microsoft Excel
32-bit or 64-bit version of the program. For Power Pivot and the Excel Power BI
tools 64-bit is better.

6. Open the file named PowerPivotDemo.xlsx located in the BEBT16 Data folder.

7. In the Yellow Security Warning bar, click Enable Content.

8. On the Ribbon, select the Power Pivot tab. In the Data Model group, select
Manage.

9. On the Power Pivot Ribbon, select the different tabs and view the options.

10. On the Quick Access toolbar, click Save. This will return you to the Excel
window.

11. On the Quick Access toolbar, click Go to the Power Pivot window. This will
return you to the Power Pivot Data Model.

12. On the bottom, select the different table tabs and view the data.

13. In the Data Model on the upper left side of the Ribbon, click the drop-down
arrow to the left of the Home tab and select Close. This will return you to the
Excel window.

14. In Excel, view the worksheet tabs.

15. Save and close the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 4


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Using Excel Lists


1. Open the file named ExcelLabs.xlsx.

Try It 2. Select the worksheet named Excel Lists, if necessary. This worksheet is an Excel
list. The first row contains column headings with no blank columns and no blank
rows within the list. A list like this one can be modified, made into a data table
then brought into Power Pivot.

3. Select cell A2.

4. On the Ribbon select the Data tab and click Sort.

5. Sort the list by Salesperson - Product Name – Quantity – Order Date.

6. Select cell A1.

7. On the Data tab, select Filter.

8. Select the Salesperson drop-down list and only choose Fuller.

9. On the Data tab in the Sort & Filter group, click Clear.

10. Scroll down to row 2158 and notice you don’t see the column headings.

11. Select cell A2.

12. On the Ribbon select the View tab and choose Freeze Panes, Freeze Panes.

13. Scroll down to row 2158 and notice you now see the column headings.

14. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 5


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Cleaning Up Data Lists


1. In the file named ExcelLabs.xlsx, select the worksheet named Clean Up Lists.
In this list, we want to check for duplicate values, remove unnecessary data and
Try It fix inconsistent data.

2. To check for duplicate values, on the Data tab select Remove Duplicates. Leave
all columns selected and click OK. Three duplicate records will be removed.

3. The Order ID needs to be just the number. To separate the field into the smallest
part needed, insert a new column B. In B2 type 10248 and press Enter. In B3
type 10248 and press Enter. On the Data tab select Flash Fill to add the number
of the Order ID to the new column B. Rename column B Order ID.

4. When the Order ID is just the number in column B, delete column A.

5. Use the Format Painter to format Order ID the same as Product Name.

6. To check for inconsistent data, select cell A2. On the Data tab select Filter. Pull
down the auto filter drop-down lists and look at the choices. Notice the
inconsistencies in the Salesperson column with King and Kinng and with
Peaacock and Peacock.

7. On the Home tab, select Find and Select then choose Replace. Fix the names in
the Salesperson column. Kinng should be King. Peaacock should be Peacock.

8. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 6


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Using VLOOKUP


1. In the file named ExcelLab.xlsx, select the worksheet named VLOOKUP.

Try It 2. To create an absolute range name, select the range A2 through B13. Click in the
Name box, and type ProductPrices and press Enter.

3. Select the range D2 through E73. Click in the Name box and type RepRegions
and press Enter.

4. Save the file.

5. Select cell L2.

6. On the Ribbon on the Formulas tab, select Lookup & Reference. Select
VLOOKUP.

7. In function arguments dialog box in the Lookup_value text box type I2.

8. Press Tab to the Table_array text box. Press F3 to get a list of the range names.
Select ProductPrices from the list and click OK.

9. Press Tab to the Col_index_num text box. Type 2 for the second column.

10. Press Tab to the Range-lookup text box. Type false.

11. Click OK.

12. In cell L2 point to the auto fill handle and double-click to copy the formula down
the column.

13. In cell M2 create a VLOOKUP function to get the Region from RepRegions list
and copy the formula down the column.

14. Select all the formulas in column L. Right-click and select Copy. Right-click and
select Paste Values to convert the formulas into values.

15. In column M, convert the formulas to values.

16. Select G2.

17. On the Ribbon select the Insert tab and choose Recommended PivotTables. From
the Recommended PivotTables list, select Sum of Price by Region and click OK.

18. Rename the worksheet tab Price by Region.

19. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 7


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating Data Tables


1. In the file named ExcelLab1.xlsx, select the worksheet named Creating Data
Tables. A data table is created from an Excel list.
Try It
2. To create a data table, select cell A1.

3. On the Ribbon select the Insert tab. In the Tables group, click Table.

4. In the create table dialog box, make sure the data range for your table is
$A$1:$B$13 and My table has headers is selected. Click OK.

5. Select cell A1. On the Ribbon on the Table Tools Design tab in the Properties
group, click in the Table Name text box. Type Products as the table name and
press Enter.

6. Select cell D1. Press Ctrl – T to create a table. Verify the range $D$1:$E$73 and
click OK.

7. Name the table in D1 SalesReps.

8. Create a table for cell G1 with the range $G$1:$K$10001.

9. Name the table in G1 Sales.

10. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 8


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Working with Data Tables


1. In the file named ExcelLab.xlsx, select the worksheet named Working with
Data Tables.
Try It
2. To create a calculated column, select cell G1. Type DiscountAmount and press
Enter. Make the column wider to see the column heading.

3. In cell G2 type =[ and then double-click Price from the list.

4. Type ]*[ and then double-click Discount.

5. Type ] and press Enter to get the discount amount. The formula should be
=[Price]*[Discount].

6. Format column G as Currency.

7. Select cell H1. Type TotalPrice and press Enter.

8. In cell H2 type =([ and then double-click Price from the list.

9. Type ]-[ and then double-click DiscountAmount.

10. Type ])*[ and then double-click Units.

11. Type ] and press Enter. The formula should be


=([Price]-[DiscountAmount])*[Units].

12. Format column H as Currency.

13. To turn off the borders, press Ctrl-A to select all. On the Home tab in the Font
group, select the borders drop-down list. Select No Border.

14. Select cell A1. On the Ribbon on the Table Tools Design tab in the Table Styles
group, select a table style. Change the style a few times.

15. On the Ribbon on the Table Tools Design tab in the Table Style Option group,
select the Total Row. Notice the total of the TotalPrice in row 10002. Select the
drop-down arrow and try some other choices. Return the total to Sum.

16. In row 10002 click in the cell to the left of the total cell. Select the drop-down
arrow and choose Count.

17. Use the auto filter drop-down list to show only SalesRep Andrew Meyer for
Product Quad. View the data then clear the filter.

18. On the Ribbon on the Table Tools Design tab in the Table Style Option group
select some other options.

19. Save the workbook.

© 2022 Online Consulting, Inc., Revised 01/07/22 9


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating and Manipulating a PivotTable


1. In the file named ExcelLab.xlsx, select the worksheet named PivotTables.

Try It 2. Select cell A1.

3. On the Ribbon select the Insert tab. In the Tables group, click PivotTable.

4. In the Create PivotTable dialog box, click OK to create a PivotTable on a new


worksheet from the range $A$1:$I$2158.

5. Rename the worksheet tab to Orders.

6. On the Orders worksheet, in the PivotTable Field List pane, select the Product
Name checkbox. The Product Name field will go to the Rows area by default
since it is a text field.

7. Select Quantity. The Quantity field will go to the Values area and will be
summed by default.

8. Right-click Salesperson and select Add to Column Labels.

9. In cell A4, select drop-down arrow and select Sort Z to A. Change it back to Sort
A to Z.

10. In cell A4 select the drop-down arrow and select Label Filters then select Begins
With. Type c in the text box and click OK. Note only the Product Names that
begin with c are displayed.

11. In cell A4 select the drop-down arrow and select Value Filters then select
Greater Than. Type 1000 in the text box and click OK. Note the values in the
Grand Total column are over 1000.

12. In cell A4 select the drop-down arrow and select Clear Filter from “Product
Name” to return all the data.

13. In the Order worksheet, note the Quantity value for Alice Mutton for Salesperson
Fuller.

14. Select the worksheet tab named PivotTables. Find the Product Name Alice
Mutton for Salesperson Fuller. Change the Quantity in column D to 100.

15. Return to the Orders worksheet. Notice the Quantity did not change.

16. On the Ribbon on the PivotTable Tools Analyze tab in the Data group, click
Refresh. Notice the change in the Quantity field for Fuller.

17. On the PivotTable Tools Analyze tab, locate the PivotTable group. In the
PivotTable Name text box, type Orders and press Enter.

18. Save the workbook.

© 2022 Online Consulting, Inc., Revised 01/07/22 10


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating Slicers


1. In the file named ExcelLab.xlsx, select the worksheet named PivotTables.

Try It 2. Select cell A1.

3. On the Ribbon on the Insert tab in the Tables group, click PivotTable.

4. In the Create PivotTable dialog box, click OK to create a PivotTable on a new


worksheet.

5. Name the worksheet tab Category by Salesperson.

6. Place the Category Name then the Product Name in the Rows area. Add the
Salesperson in the Columns area, and the Extended Price in the values.

7. Name the PivotTable CategoryProduct and press Enter.

8. On the Ribbon on the PivotTable Tools Analyze tab in the Filter group select
Insert Slicer.

9. Select Category Name and Salesperson and click OK.

10. Drag the slicers to the right of the PivotTable.

11. Select the Category Name slicer. On the Slicer Tools Options tab, select a
different Slicer Style to change the color of that slicer.

12. In the Category Name slicer window, select Beverages.

13. In the Salesperson slicer window, select Fuller.

14. In the Salesperson slicer window, Ctrl-click Callahan.

15. In the Category Name and Salesperson slicers, click the Clear Filter icon to
return all the data.

16. Save the workbook.

© 2022 Online Consulting, Inc., Revised 01/07/22 11


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating a PivotChart


1. In the file named ExcelLab.xlsx, select the worksheet named PivotTables.

Try It 2. Select cell A1.

3. Create a new PivotTable on a new worksheet. Rename the new worksheet to


Order Dates.

4. Select Salesperson for the Rows, Order Date for the Columns and Quantity for
Values.

5. Name the PivotTable SalespersonQuantity and press Enter.

6. Right-click cell B4 and select Group. Only select Months and click OK.

7. On the Ribbon on the PivotTable Tools Analyze tab in the Tools group, select
PivotChart. Leave the default column type and click OK.

8. With the PivotChart still selected, on the Ribbon in the on the PivotChart Tool
Design tab in the Location group, select Move Chart.

9. Select New Sheet and name the sheet Quantity Ordered Chart and click OK.

10. On the PivotChart Tools Analyze tab, locate the PivotTable group. In the Chart
Name text box, verify the name is Quantity Ordered Chart.

11. In the Quantity Ordered Chart worksheet, select the Order Date filter drop-down
list. Select Jan, Feb and Mar and click OK.

12. On the Design tab of the PivotChart Tools, select Change Chart Type and select
3-D Clustered Column and click OK.

13. On the PivotChart Tools Design tab, select Quick Layout. Select Layout 9.

14. Change the text for the chart title to First Quarter Sales. Change the text for the
left side Axis Title to Quantity. Change the bottom Axis Title to Salesperson.

15. Select the Chart Elements icon within the chart. Select the Data Table checkbox.
Clear the Legend checkbox. Click the Chart Elements icon again to collapse the
list.

16. On the PivotChart Tools Design tab, select a Chart Style.

17. Add any additional chart formatting as desired.

18. Save the workbook.

© 2022 Online Consulting, Inc., Revised 01/07/22 12


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating Sparklines


1. In the file named ExcelLab.xlsx, select the worksheet named Order Dates.

Try It 2. Select cell G5.

3. On the Ribbon select the Insert tab. Locate the Sparklines group and select
Column.

4. In the dialog box, select B5:D5 as the Data Range and click OK.

5. Use the Auto Fill handle to copy cell G5 to G14.

6. Select G5.

7. On the Ribbon on the Sparkline Tools Design locate the Show group. Select High
Point. Notice the highest bar turns red.

8. Save the workbook.

© 2022 Online Consulting, Inc., Revised 01/07/22 13


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Applying Conditional Formatting


1. In the file named ExcelLab.xlsx, select the worksheet named Order Dates.

Try It 2. Select cell B5:D13.

3. On the Ribbon select the Home tab. Locate the Styles group and select
Conditional Formatting.

4. Point to Data Bars and then point to the green data bar.

5. Point to Color Scales and then point to the different options.

6. Point to Icon Sets and then point to the different options.

7. Select Top/Bottom Rules and then select Top 10 Items.

8. In the dialog box, change the 10 to 3 with Light Red Fill with Dark Red Text and
click OK.

9. Save the workbook.

© 2022 Online Consulting, Inc., Revised 01/07/22 14


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating Normalized Tables


A relationship is a connection between two tables that contain data: one column in
each table is the basis for the relationship. Relationships are needed to pull data from
Try It more than one data source. For example, using fields from two tables to create a
PivotTable. For more detail information on relationships, see the link below:

https://support.office.com/en-us/article/Relationships-between-tables-in-a-Data-
Model-533DC2B6-9288-4363-9538-8EA6E469112B

1. In the file named ExcelLab.xlsx, select the worksheet named Normalized.

2. Using the fields list in column A, place each field under the appropriate table
Sales Table, Product Table, Sales Rep Table or Customer Table.

3. Bold the primary key field.

4. Italicize the foreign key field.

5. On the Ribbon on the Insert tab use the Shapes drop-down list and draw an arrow
from the primary key field in one table to the foreign key field in the other table.

6. Scroll down to cell C50 to view the results.

7. Press Ctrl-S to save the file.

8. Press Ctrl-W to close the workbook.

© 2022 Online Consulting, Inc., Revised 01/07/22 15


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating a PivotTable with More Tables


In this exercise, we are going to build relationships between three different Excel
tables from the perspective of Excel without having to go to the Data Model. This
Try It will allow us to be able to create PivotTables using fields from different tables. Later
we will do this from the perspective of the Data Model.

1. Open the file named SalesTables.xlsx.

2. On the Data Tables worksheet select cell A1.

3. On the Ribbon on the Insert tab in the Tables group, select Table.

4. Note the range A1:B13 and click OK.

5. On the Table Tools Design tab in the Properties group click in the Table Name
text box. Type Products and press Enter.

6. Create a table named SalesReps for the range D1:E73.

7. Create a table named Sales for the range G1:K10001.

8. Save the file.

9. Select cell G1.

10. Create a PivotTable on a new worksheet.

11. In the PivotTable Fields list, click More Tables. Click Yes. Note the Products,
Sales, and SalesReps tables have been added to the PivotTable Fields list.
However, the lines between the tables indicate that the tables have not been
related.

12. Click the triangle in front of SalesReps to expand the list. Select SalesRep for the
Rows area.

13. Add the Products from the Products table to the Columns area.

14. Add the Units from the Sales table to the Values area.

15. In the PivotTable Fields list, note the yellow bar with the text Relationships
between tables may be needed. Click CREATE.

16. In the Create Relationship dialog box, select the Table drop-down list and select
Data Model Table: Sales. Select the Column (Foreign) drop-down list and select
Products. Select Data Model Table: Products for Related Table and Products
for the Related Column (Primary). Click OK.

17. Click CREATE again.

18. Select the Table drop-down list and select Data Model Table: Sales. Select the
Column (Foreign) drop-down list and select SalesRep. Select Data Model
Table: SalesReps for Related Table and SalesRep for the Related Column
(Primary) and click OK.

© 2022 Online Consulting, Inc., Revised 01/07/22 16


ONLC Training Centers Excel BI Tools Labs and Reviews

19. Now that the tables are related, notice the yellow bar has disappeared.

20. Save the workbook.

21. On the Quick Access Toolbar, select Go to the Power Pivot window.

22. In the Power Pivot window, note the three tables Sales, SalesReps and Products
have been added to the Data Model.

23. On the Power Pivot Home tab, select Diagram View. Notice the tables are linked
with the relationships that were just created in the Create Relationship dialog
box.

24. On the Ribbon on the Home tab, click Data View.

25. On the Home tab in the Formatting group, select PivotTable then PivotTable.
Click OK for a new worksheet. Once in the PivotTable notice that the field list
has no lines between the tables indicating they are related.

26. From the Products table, add Product to Rows. From the Sales table, add Units
to Values.

27. On the Quick Access Toolbar, click Save.

28. In the Excel window, from the SalesReps table add Region to the Rows area
above Products.

29. Select cell A4.

30. On the Ribbon on the PivotTable Tools Analyze tab, in the Active Field group,
select Collapse Field.

31. Expand the field.

32. Save and close the file.

33. If necessary, close any other Excel workbook.

© 2022 Online Consulting, Inc., Revised 01/07/22 17


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Importing Data into Power Pivot


1. Open Windows Explorer and Navigate to the student data folder.

Try It 2. Double-click Categories.txt to open the file and view the data. Note the data is
delimited by commas. Close the text file.

3. Double-click Traders.accdb. In the Security Warning yellow bar, click Enable


Content.

4. In the All Access Objects navigation pane on the left, double-click tblCustomers
and view the data.

5. Open the other tables and view the data. Close Access.

6. Double-click Employee.xlsx to open the file and view the data.

7. In the Employee.xlsx file, select cell A1.

8. On the Ribbon select the Insert tab. In the Tables group click Table.

9. Verify the range A1 through O10. Make sure My table has headers is selected.
Click OK.

10. Click in cell A1.

11. On the Ribbon on the Table Tools Design tab in the Properties group click in the
Table Name text box. Type Employees and press Enter.

12. To add this Excel table to the data model, on the Ribbon select the Power Pivot
tab. In the Tables group, click Add to Data Model.

13. In Power Pivot view, maximize the window if necessary.

14. Note the Employees tab in the lower left with the link icon indicating that this
table is linked to this Excel file.

15. To add a text file to the Data Model, on the Ribbon on the Power Pivot Home tab
in the Get External Data group, select From Other Sources. Scroll down and
select Text File. Click Next.

16. Click Browse and navigate to the student data folder. Select Categories.txt and
click Open.

17. Make sure the Column Separator is set to Comma (,) and Use first row as column
headers is selected. Click Finish.

18. In the Table Import Wizard dialog box, note the success of the imported data.
Click Close. Note the tab in the lower left named Categories.

19. To import Access tables, on the Ribbon on the Power Pivot Home tab, select
From Database. Choose From Access.

20. In the Table Import Wizard, click Browse. Select the Traders.accdb file from the
student data folder and click Open. Click Next.

© 2022 Online Consulting, Inc., Revised 01/07/22 18


ONLC Training Centers Excel BI Tools Labs and Reviews

21. Make sure Select from a list of tables and views to choose the data to import is
checked and click Next.

22. From the Database list under Tables and Views, select all the tables by checking
tblCustomers, tblOrderDetails, tblOrders, tblProductPriceAdjustments,
tblProducts, tblShippers, and tblSuppliers.

23. Select the tblCustomers table row and click the Preview & Filter button to view
the data. After viewing the data, click OK.

24. Click Finish. If the security warning dialog box is displayed, click OK. Note the
success of the imported data.

25. Click Close. Note the additional tabs for the tables at the bottom left.

26. On the Quick Access Toolbar, click Switch to Workbook to return to Excel.

27. In Excel select the File tab and choose Save as. Navigate to the student data
folder. Name the file Traders.xlsx. Click Save. Do NOT close this file.

© 2022 Online Consulting, Inc., Revised 01/07/22 19


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Refreshing Data from Data Sources


1. In the Traders.xlsx file.

Try It 2. Click Enable Content in the yellow Security Warning bar, if necessary.

3. On the Ribbon select the Power Pivot tab and select Manage.

4. In the tblCustomers table note the CustomerID ALFKI and ContactTitle of Sales
Representative in the first row of data.

5. Open Access. Open Traders.accdb. Click Enable Content in the yellow Security
Warning bar, if necessary.

6. In Access open the tblCustomers table. Move to the CustomerID ALFKI record.
Change the ContactTitle to Owner. Move to the next record in the table to save
your changes.

7. Close Access.

8. Return to the Data Model in the Excel Traders.xlsx file. Note the record is not
changed to Owner for CustomerID ALFKI.

9. On the Power Pivot Ribbon on the Home tab click Refresh.

10. In the Data Refresh dialog box, note success and click Close.

11. In Power Pivot, note the change to the ContactTitle now Owner in the first row.

12. On the Quick Access Toolbar, click Save.

13. In Excel, change the Address for Steven Buchanan from 14 Garrett Hill to 14
Garrett Hill Drive. Save the file.

14. On the Ribbon select the Power Pivot tab. Click Manage.

15. On the bottom, switch to Employees table. Note the Address. If the Address has
not changed, on the Ribbon select the Linked Table tab and choose Update
Selected. Note the Address has changed.

16. On the Ribbon on the Linked Table tab select Go to Excel Table.

17. In Excel, change the PhoneNumber for Nancy Davolio to (206) 555-9898. Save
the file.

18. Return to Power Pivot and note the change.

19. On the Power Pivot Ribbon, select the Linked Tables tab. In the Linked Tables
group, select Update All. This would update all Excel tables that are linked to
Power Pivot if necessary. Save the file.

20. To add an Excel table to the Data Model that is not contained in this Traders file,
on the Ribbon on the Power Pivot Home tab in the Get External Data group,
select From Other Sources then choose Excel File. Click Next.

© 2022 Online Consulting, Inc., Revised 01/07/22 20


ONLC Training Centers Excel BI Tools Labs and Reviews

21. Click Browse and select BaltimoreSales.xlsx. Click Open. Select Use first row
as column headers. Click Next. Click Finish. Click Close.

22. Note the new Baltimore Sales table added to the Data Model and that this table
does not have the link icon because this table came from a different Excel file.

23. Right-click the Baltimore Sales tab and select Delete. Click Yes to remove this
table from the Data Model.

© 2022 Online Consulting, Inc., Revised 01/07/22 21


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Working with Power Pivot Tables


1. In the Excel file named Traders, on the Ribbon select the Power Pivot tab and
click Manage.
Try It
2. Select the tblOrderDetails table.

3. Select the column heading Discount. On the Power Pivot Home tab, locate the
Formatting group. Click Apply Percentage Format. Click Decrease Decimal to
show zero decimal places.

4. In tblOrders, select the OrderDate, RequriedDate, and ShippedDate columns.


Format these columns to have the Data Type of Date with the format of
3/14/2001.

5. Drag the table tabs to move the tables in the following order: tblCustomers,
tblProducts, Categories, tblProductPriceAdjustments, tblShippers, tblSuppliers,
Employees, tblOrders, tblOrderDetails.

6. Right-click the tblProductPriceAdjustments table tab and select Delete. Click Yes
to permanently delete the table.

7. A fact table holds data entries that comprise a set of facts related to a company's
business operations. Each row in a fact table represents an individual transaction
or event; the columns document the different data elements that come into play in
processing the ones captured in the table. This Data Model has two transactional
tables: tblOrders and tblOrderDetails. To indicate the tblOrders table as a fact
table, right-click tblOrders, select Rename and change the name to FactOrders.
Best practices suggest no spaces in table names.

8. Rename the other fact table tblOrderDetails to FactOrderDetails.

9. A dimension table contains data attributes that support a transactional table. For
example, the CustomerID would be in the transactional table but the
CustomerName, CustomerAddress, etc., would be in the dimensions table. This
Data Model has many transactional tables. To indicate a dimensions or related
table, right-click tblCustomers. Select Rename and change the name to
DimCustomers.

10. Rename all the other dimension tables. Rename tblProducts to DimProducts.
Rename Categories to DimCategories. Rename tblShippers to DimShippers.
Rename tblSuppliers to DimSuppliers. Rename Employees to DimEmployees.

11. Select DimCustomers. To change the column widths for all the columns, click in
a cell containing data. Press Ctrl-A to select all. Move the mouse point on the
divide line between the fields CompanyName and ContactName. With the mouse
point as a double-headed arrow, double-click.

12. Select DimSuppliers. To delete a column, right-click the HomePage column


heading. Select Delete Columns. Click Yes to permanently delete the column.
Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 22


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Building Relationships


In a data model, table relationships can be one-to-one (each customer has a single
address) or one-to-many (each customer could have many orders), but not many-to-
Try It many. The data types in the two columns must be compatible but do not have to
have the same field names. When creating relationships in Diagram View, fields can
be dragged and dropped to fields on other tables. Excel will automatically detect the
type of relationship between these tables (one-to-one versus one-to-many).

1. In Traders in Excel return to the Data Model, if necessary.

2. On the Power Pivot Home tab in the View group, click Diagram View. In
Diagram View, relationships can be made by dragging a field from one table to a
related field in another table. Power Pivot will automatically determine the
relationship type once you drag one field to the other field. Relationships in
Power Pivot can be one to one or one to many.

3. On the black bar on the bottom right, click Fit to Screen. Notice the 8 tables.

4. Drag the last four tables one at a time and place them below the first four tables
so all the tables are on the left-hand side of the screen.

5. On the black bar on the bottom right, click Fit to Screen.

6. Starting with DimEmployees, point to the bottom of the table window. With the
mouse pointer as a double-headed arrow, click and drag to display all fields.

7. Resize the other tables to display all the fields so that no scroll bars are displayed.

8. On the black bar on the bottom right, click Fit to Screen.

9. In the Diagram View window drag the tables so you can see them all on the
screen. Move FactOrderDetails and FactOrders in the middle on the second row.
Place the dimension tables on the top row in the order: DimCustomers,
DimProducts, DimCategories, DimShippers, DimSuppliers, and DimEmployees.

The screen should look like the diagram below:

© 2022 Online Consulting, Inc., Revised 01/07/22 23


ONLC Training Centers Excel BI Tools Labs and Reviews

10. In DimCategories, drag the CategoryID field to the DimProducts CategoryID.


Once you release the mouse button, a join line is established between the two
tables. Make sure the CategoryID field is selected in both tables. Note the 1 by
the DimCategories table and the * next to the DimProducts table. This indicates
there is one CategoryID in the DimCategories table to many CategoryID’s in the
DimProducts table.

11. Double-click the join line to bring up the Edit Relationships dialog box. View the
information. Click OK to close it.

12. On the Power Pivot Ribbon, click the Design tab. In the Relationships group,
click Create Relationship.

13. To relate the FactOrderDetails to DimProducts, select the table drop-down list
and choose FactOrderDetails. In the columns area, click the ProductID to select
that field. It will turn blue. In the second table drop-down list, select
DimProducts as the table. In the columns area select ProductID. Click OK. Note
the relationship line between the two tables.

14. Relate FactOrders OrderID to FactOrderDetails OrderID.

15. Relate FactOrders CustomerID to DimCustomers CustomerID.

16. Relate FactOrders EmployeeID to DimEmployees EmployeeID.

17. Relate DimSuppliers SupplierID to DimProducts SupplierID.

18. Note that DimShippers is not related to any table.

19. On the Power Pivot Design tab locate the Relationships group. Click Manage
Relationships. Note the 6 relationships that were just created. Click Close.

20. After the 6 relationships are created, on the Power Pivot Ribbon on the Home tab
in the View group, click Data View. Save the File.

© 2022 Online Consulting, Inc., Revised 01/07/22 24


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating a PivotTable with Relationships


1. In the Traders Excel file return to the Data Model, if necessary.

Try It 2. On the Power Pivot Home tab, click PivotTable then PivotTable.

3. In the Create PivotTable dialog box, make sure New Worksheet is selected and
click OK.

4. Name the worksheet tab ProductOrdersbySalesrep.

5. In the PivotTable Fields list, notice all the tables from the Data Model are listed.
Note that DimShippers is below the line since it is not related to another table.

6. In the PivotTable Fields list, notice the Employees table does not have Dim in
front of the name. The table tab in the Data Model was renamed but the Excel
table name was not changed. To change this name, in Excel select the
tblEmployees worksheet tab. On the Ribbon, select the Table Tools Design tab.
In the Table Name text box change the table name to DimEmployees and press
Enter.

7. Return to the ProductOrdersbySalesrep worksheet.

8. From the PivotTable Field list, expand DimProducts. Select ProductName. This
field will go to the Rows area of the PivotTable. Collapse the DimProducts table.

9. In the PivotTable Field list, expand FactOrderDetails. Select Quantity. This field
will go to the Values area of the PivotTable. Collapse the FactOrderDetails table.

10. In the PivotTable Field list, expand DimEmployees, select the LastName field.
This field will go to the Rows area. Drag the LastName field from the Rows area
to the Columns area.

11. Add another worksheet tab. Name this worksheet EmployeeQuantities.

12. Select the Insert tab and click PivotTable. In the Create PivotTable dialog box,
make sure Use this workbook’s Data Model is selected and Existing Worksheet
is selected. Click OK to create another PivotTable for the Data Model.

13. In the PivotTable Fields list, select the DimEmployees LastName field for the
Rows area and the FactOrderDetails Quantity field for the Values area.

14. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 25


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating a Hierarchy


In the Data Model, a hierarchy is a list of columns that are considered a single item.
For example, if you have geographic data, you might want to create a hierarchy that
Try It starts with country, and drill down to region and city. A hierarchy appears as a single
object in the Field List and can be used in a PivotTable report or a Power View
report.

1. In Traders return to the Data Model.

2. Change the view to Diagram View.

3. In DimCustomers, right-click Country and select Create Hierarchy.

4. Type Geographic Hierarchy as the name and press Enter. Notice Country is
already listed under Geographic Hierarchy.

5. Expand the DimCustomers table so you have about an inch of extra space at the
bottom of the table.

6. Drag the Region field under Country in the hierarchy.

7. Drag the City field under Region.

8. On the Ribbon on the PivotTable Home tab, switch the view to Data View.

9. Select the DimCustomers table. Notice the Geographic Hierarchy is not listed as
a column in the table.

10. To use the hierarchy in a PivotTable, on the Ribbon on the Power Pivot Home
tab select PivotTable. In the Create PivotTable dialog box, click OK for a
PivotTable on a new worksheet.

11. Name the worksheet tab Geographic Category. Save the file.

12. In the PivotTable field list, expand DimCustomers.

13. Select Geographic Hierarchy. The field will go to the Rows area.

14. Expand DimCategories and drag the CategoryName field to the Columns area.

15. Expand FactOrderDetails and click Quantity. This field will go to the Values
area.

16. Click in cell B24 for USA.

17. On the PivotTable Tools Analyze tab in the Active Field group, select Expand
Field then click Collapse Field.

18. Scroll back up to B24. On the PivotTable Tools Analyze tab in the Active Field
group, select Drill Down.

19. Select cell B5 and choose Drill Down.

20. Select cell B5. On the Ribbon, select then Drill Up twice to return to Country.

© 2022 Online Consulting, Inc., Revised 01/07/22 26


ONLC Training Centers Excel BI Tools Labs and Reviews

21. Right-click cell B24 and point to Expand/Collapse. Select Expand to City.

22. In cell B24, click the smart tag Quick Explore. Select Drill Down Region.

23. Select cell B6 and use Quick Explore and choose Drill Down City.

24. Return the PivotTable to Country.

25. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 27


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating a Calculated Column


A calculated column adds a new column of data to a table in the Data Model. Using a
Data Analysis Expressions (DAX) formula that defines the column values which then
Try It calculates row by row in the table. For example, Units multiplied by Price to get a
Total Price column. Once created, calculated columns can be used in PivotTables,
PivotCharts or Power View reports just as you would use any other column.

1. In Excel, add a new worksheet tab. Name the worksheet tab


TotalPricebyCategory.

2. On the Ribbon, select the Insert tab and click PivotTable. In the Create
PivotTable dialog box, make sure Use this workbook’s Data Model is selected
and Existing Worksheet is selected. Click OK. Note: if you are using Excel 2013
this option is not available. To create a new PivotTable on a new worksheet,
return to the Data Model. On the Home tab select PivotTable then select
PivotTable and click OK.

3. In the PivotTable Fields list, from the DimCategories table, add Category Name
to Rows area.

4. On the Ribbon on the PivotTable Tools Analyze tab in the Calculations group
select Fields, Items and Sets. Notice that you cannot create a calculated field (it is
greyed out). In the Data Model, calculated columns and calculated measures can
be created.

5. To create a calculated column for the total price, return to the Data Model.

6. Select the FactOrderDetails tab.

7. Notice the Add Column field at the end of the table.

8. Double-click Add Column and type TotalPrice as the field name and press Enter.

9. In the first cell under TotalPrice, type = and notice the equal symbol is in the
formula bar.

10. Click the column heading UnitPrice and notice that gets added to the formula in
square braces.

11. Type * for multiplication.

12. Click the column heading Quantity. The formula should read:
=[UnitPrice]*[Quantity] then press Enter. Note the total price is calculated for all
the rows. Also note that the new calculated field’s heading is in black and the
color gray is a little darker.

13. In the Data Model, best practices suggest that you always add the table name to a
calculation even though you do not have to. To modify the formula to include the
table name, click in the formula bar after the = symbol. Type the letter F for Fact
and a listing will be displayed. Double-click FactOrderDetails. Click in front of
[Quantity] and type a F and double-click FactOrderDetails. The formula should
read: =FactOrderDetails[UnitPrice]*FactOrderDetails[Quantity] then press Enter.

14. Save the file to return to Excel.

© 2022 Online Consulting, Inc., Revised 01/07/22 28


ONLC Training Centers Excel BI Tools Labs and Reviews

15. Select the worksheet tab TotalPricebyCategory.

16. Click in the PivotTable, if necessary.

17. In the PivotTable Fields list, open the FactOrderDetails table. Notice the new
field named TotalPrice.

18. Select TotalPrice and the field gets added to the Values area of the PivotTable.

19. Return to the Data Model.

20. Select the DimProducts table.

21. Double-click Add column. Name the column TotalStockPrice and press Enter.

22. Create a calculated column that will take the DimProducts UnitPrice and multiple
it by the DimProducts. UnitsInStock. The formula should be:
=DimProducts[UnitPrice]*DimProducts[UnitsInStock]

23. On the Home tab, select PivotTable. Create a PivotTable on a new worksheet.
Add from the DimProducts table the ProductName and TotalStockPrice.

24. Name the worksheet TotalStockPrice.

25. Return to the Data Model.

26. In FactOrderDetails, create a calculated column named DiscountAmount that


takes the TotalPrice multiplied by the Discount. The formula should be:
=FactOrderDetails[TotalPrice]*FactOrderDetails[Discount]

27. In FactOrderDetails, create another calculated column named


TotalDiscountedPrice that takes the TotalPrice minus the DiscountAmount. The
formula should be:
=FactOrderDetails[TotalPrice]-FactOrderDetails[DiscountAmount]

28. Create a new PivotTable. Add the Employee’s Last Name in the Rows area. In
FactOrderDetails, add the TotalPrice, DiscountAmount and
TotalDiscountedPrice to the PivotTable.

29. Name the worksheet TotalPricebyRep.

30. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 29


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating Measures


A measure is a calculation used in data analysis such as sum, average or more
advanced calculations using Data Analysis Expressions (DAX) formulas. The value
Try It of a measure always changes in response to selections on rows, columns, and filters.
Measures are most often used in the Values area of a PivotTable or PivotChart.

1. In Traders, return to the Data Model. Select FactOrderDetails.

2. Click in the calculation area under the UnitPrice field.

3. On the Power Pivot Home tab in the Calculations group, pull down the AutoSum
drop-down list and select Average. Note the calculated measure Average of
UnitPrice is added.

4. Make the column wider and note the average of UnitPrice is $26.19.

5. On the Ribbon on the Power Pivot Home tab, click PivotTable, then PivotTable.
Make sure New Worksheet is selected and click OK.

6. In the PivotTables Fields list, expand FactOrderDetails. Notice the field Average
of UnitPrice is listed in the PivotTable Fields list and it has a fx next to it to
indicated it is a measure. Select the field and note it is added to the Values area.
Note the Average of UnitPrice is $26.19

7. From DimProducts, select the ProductName field. Add the ProductID under the
ProductName in the Rows area. Note the first ProductName Alice Mutton
ProductID 17 has an Average of UnitPrice of $35.51.

8. Name the worksheet AverageUnitPrice. Save the file. Return to the Data Model.

9. In FactOrderDetails, select the ProductID drop-down list. Clear the check for
(Select All). Select only 17. Note the Average of UnitPrice of $35.51.

10. Select the ProductID drop-down list and select Clear Filter From ProductID to
display all the ProudctID’s.

11. In FactOrderDetails, click in the calculation area under the OrderID field.

12. On the Power Pivot Home tab in the Calculations group, pull down the AutoSum
drop-down list and select Count. Note the number of records in table.

13. Move to the next row in the calculation area under the OrderID field.

14. On the Power Pivot Home tab in the Calculations group, pull down the AutoSum
drop-down list and select Distinct Count. Notice the difference total from Count.
Distinct Count shows how many unique OrderID’s are in this table.

15. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 30


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Working with Measures


1. In Traders, return to the Data Model.

Try It 2. Select the FactOrderDetails table.

3. Select the first cell in the Calculation area under TotalPrice.

4. On the Power Pivot Home tab, select AutoSum and note the calculated measure
is created. Widen the column, if necessary, to display the total. Note the field
name is Sum of TotalPrice 2.

5. On the Power Pivot Ribbon, select the Advanced tab and click Show Implicit
Measures. Notice there is a Sum of TotalPrice field in the calculation area. We
created the calculated column TotalPrice and then added it to the Values area in a
PivotTable. This sums up the TotalPrice field when it generates the PivotTable
which makes this an implicit measure. Since we cannot have two fields with the
same name. this new field is call Sum of TotalPrice 2. This is an explicit
calculated measure since we created the calculation in the Data Model. Best
practices suggest that you create any calculation that you need in the Data Model
first before adding fields to the PivotTable Values area to avoid creating implicit
measures. Creating explicit measures is more efficient.

6. On the Power Pivot Ribbon on the Advanced tab, click Show Implicit Measures
to turn off the display of implicit measures.

7. Return to Excel.

8. To create a measure for the Sum of Quantity to see how many total items were
ordered, on the Excel Ribbon select the Power Pivot tab. In the Calculations
group, select Measures then select New Measure. Measures can be created here
or in the calculation area of the table in the Data Model.

9. In the measures dialog box in the Table name text box, select the drop-down
arrow and choose FactOrderDetails.

10. In the Measure name, type TotalQuantityOrdered.

11. In the Description text box, type Total Number of Items Ordered.

12. In the Formula text box, type =s and note the list of functions that begin with s
are displayed. Type um( so the formula is =sum( at this point. Next type F and
notice the list of columns and measures. Double-click
FactOrderDetails[Quantity] to add the field then close the ). The formula should
be =sum(FactOrderDetails[Quantity]).

13. Click Check formula and in the yellow box it should say No errors in formula.

14. In the Formatting Options Category, select Number then select Decimal Number
with 0 decimal places. Select use 1000 separator. Click OK.

15. If the TotalQuantityOrdered was added to the current PivotTable, in the


PivotTable Fields list, clear the check for TotalQuantityOrdered in the
FactOrderDetails table.

© 2022 Online Consulting, Inc., Revised 01/07/22 31


ONLC Training Centers Excel BI Tools Labs and Reviews

16. Save the file then return to the Data Model.

17. If necessary, widen the columns to show all the values and calculations for each
column. Note where the TotalQuantityOrdered field is placed. When measures
are created in the Measures dialog box, they are always placed in the first column
in the calculation area.

18. Select the first cell in the Calculation area under Quantity.

19. On the Power Pivot Ribbon Home tab, select AutoSum. Note the new calculated
measure under the Quantity column named Sum of Quantity 2. Also, note the
total in this field is the same as the total in TotalQuantityOrdered field.

20. Return to Excel.

21. On the Excel Ribbon on the Power Pivot tab, select Measures. Click Manage
Measures.

22. Select TotalQuantityOrdered and click Edit. Note the calculation. Click OK.

23. Select Sum of Quantity 2 and click Edit. Note the same calculation but no
formatting. Format the field with Number then select Decimal Number with 0
decimal places. Select use 1000 separator. Click OK. Click Close.

24. Save the file.

25. Return to the Data Model.

26. In the FactOrderDetails table, note the formatting for the Sum of Quantity 2
field.

27. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 32


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Sorting and Filtering Fields


In the Data Model, when you sort and/or filter the result is carried through to an
Excel PivotTable report. Sorted and/or filtered data can also be copied and pasted
Try It from the Data Model into an Excel worksheet.

1. In Traders, return to the Data Model.

2. Select the FactOrderDetails table.

3. In the OrderID field, select the drop-down list and select Sort Smallest to
Largest.

4. Filter the ProductID for product 2. Note the calculations in the calculations area
change.

5. Clear the filter for ProductID.

6. In the Quantity field, find all the Quantities over 50.

7. Under the Sum of Quantity in the calculation area, add a calculated measure to
show the Count of Quantity. Notice on the status bar on the bottom that 159
records have a quantity of greater than 50.

8. Under the Count of Quantity in the calculation area, add a calculated measure to
show the Distinct Count of Quantity. The result should be 18 indicating there are
18 unique values in quantity over 50.

9. Select a cell in the Quantity field. Press Ctrl-A to select all. Press Ctrl-C to copy.

10. Return to Excel.

11. Add a new worksheet in the Excel file.

12. Select cell A1. Press Ctrl-V to paste. Note that only the filtered records are copies
to the worksheet.

13. On the Home tab in Excel, locate the Alignment group. Note that Wrap Text is
selected. Click Wrap Text to turn it off. Click select all in the Excel worksheet.
Double-click the divide line between column A and column B to increase all the
column widths to display all the information.

14. Name the new worksheet QuantityOver50.

15. Return to the Data Model.

16. Clear the filter from Quantity.

17. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 33


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating a Value Key Performance Indicator (KPI)


Key Performance Indicators (KPIs) are visual measures of performance to help
evaluate the current value against a target. To create a KPI, a measure must be
Try It calculated first then used in the KPI dialog box as the base measure to gauge the
performance of a value. In this exercise, we want to see how the Total Price by
Product compared to a target value of $10,000.

1. In Traders in Excel, select the Power Pivot tab. In the Calculations group, select
KPIs then New KPI.

2. Select the drop-down for the KPI Base field (value). Select Sum of TotalPrice 2.

3. In Define target value select the Absolute value text box. Type 10000.

4. In the Define status thresholds, select the left side filter icon and drag it to 5000.
Select the right-side filter icon and drag it to the target of 10000.

5. Leave the Select icon style to the first one with the red, yellow and green circles.

6. Click OK.

7. Return to the Data Model. Note the new KPI icon in the calculation area next to
the Sum of TotalPrice 2.

8. In the Data Model, create a New PivotTable on a new worksheet.

9. In the PivotTable Fields list, select from DimProducts the ProductName field.

10. Expand the FactOrderDetails table list, then expand the Sum of TotalPrice 2 KPI
list. Select Value and Status.

11. Double-click C3. In the Custom Name box, type Total.

12. Double-click D3 and name that field Target 10000.

13. Change the name in B3 to Products.

14. Save the worksheet tab as TotalKPI.

15. In the Ribbon on the Power Pivot tab, select KPIs and then Manage KPIs.

16. Select Sum of TotalPrice2 and click Edit.

17. In the dialog box on the bottom, select a different icon style. Click OK. Click
Close. Notice the KPIs in column D did not change.

18. In the PivotTable Fields list, expand the FactOrderDetails table list, then expand
the Sum of TotalPrice 2 KPI list. Clear Status, then select Status again. The new
KPI icons will now be displayed.

19. On the Excel Ribbon select the Home tab. In the Styles group, select Conditional
Formatting and choose Manage Rules. Click Icon Set and select Edit Rule.

© 2022 Online Consulting, Inc., Revised 01/07/22 34


ONLC Training Centers Excel BI Tools Labs and Reviews

20. In the Edit Formatting Rule dialog box, select the drop-down arrow for Icon
Style. Select a different style and click OK. Click OK to close the conditional
formatting dialog box. Notice the icon style has changed.

21. Select cell E3 or the next cell after the column headings.

22. On the Ribbon select the Data tab and choose Filter.

23. In D3, use the auto filters drop-down list to filter the list by -1. Note that all the
lower range values are selected.

24. Change the filter to 1 and note all the higher range values are selected.

25. Change the filter to 0 and note all the middle range values are selected.

26. Clear the filter.

27. Save the file.

28. In the Ribbon on the Power Pivot tab, select KPIs and then Manage KPIs.

29. Select Sum of TotalPrice2 and click Edit.

30. Change the KPI to the icon style that has 5 black and white circles and click OK.
Click Close. Notice that only 3 of the 5 circles are displayed.

31. On the Excel Ribbon select the Home tab. In the Styles group, select Conditional
Formatting and choose Manage Rules. Click Icon Set and select Edit Rule.

32. Change the icon style to one of the ones that has 4 circles. Switch it back to the 5
black and white circles. Notice the 80 Percent value next to the black circle as
well as the different percentages next to the other circles.

33. Click OK. Notice how the KPIs are now five different circles.

34. Filter the KPIs and notice the choices -2 to 2 for the filter options. Filter the list
as desired.

35. Clear the filters.

36. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 35


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating a Measure Key Performance Indicator (KPI)


In this exercise, we want to see how the Employees (sales people) Total Price of
items sold compared to their individual sales quotas.
Try It
1. In Excel, switch to the tblEmployees worksheet.

2. In column P, add a Quota column for the employees with the following quotas:

Davolio Nancy 175000


Fuller Andrew 150000
Leverling Janet 190000
Peacock Margaret 200000
Buchanan Steven 100000
Suyama Michael 100000
King Robert 160000
Callahan Laura 125000
Dodsworth Anne 100000

3. Save the Excel file and return to the Data Model.

4. In the DimEmployees table, format the Quota field as currency.

5. In the DimEmployees table, move to the calculation field area under the Quota
column. Sum the Quota column. Change the name of the calculated measure to
SumQuota. Format the measure as currency.

6. In the FactOrderDetails, move to the calculation field area under the TotalPrice
column. Sum the TotalPrice column. Change the name of the calculated measure
to SumTotalPrice. Format the measure as currency.

7. Create a PivotTable on a new worksheet. Name the worksheet SalesQuota.

8. From the PivotTable field list, add the DimEmployees Last Name field to the
Rows area.

9. In Excel, on the Power Pivot Ribbon, select KPI, New KPI.

10. For the KPI base field (value), select SumTotalPrice. For the Measure, select
SumQuota. Define the status thresholds as below 80%, 80%-95%, and 95%.
Click OK.

11. In the PivotTable field list in the FactOrderDetails table, clear the status for the
SumTotalPrice KIP. Select SumTotalPrice KPI Value, Goal and Status. Notice
who made their sales quota.

12. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 36


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Conditional Formatting


1. In Traders, return to the Data Model.

Try It 2. Select the DimEmployees table.

3. Add a new column named FullName with the calculation


=DimEmployees[FirstName]&” “&DimEmployees[LastName].

4. On the Power Pivot Ribbon on the Home tab, select PivotTable and create a
PivotTable on a new worksheet.

5. In the PivotTables Fields list, open the DimEmployees table and select
FullName.

6. Open the FactOrderDetails table and select Distinct Count of OrderID.

7. Name the worksheet OrdersbySalesRep.

8. Select cells C4:C12.

9. On the Excel Ribbon on the Home tab, locate the Styles group and select
Conditional Formatting.

10. In Conditional Formatting list, select Top/Bottom Rules then select Top 10
Items.

11. Change the number down to 3 and select Fill Green with Dark Green Text. Click
OK. Note the top three sales reps who had the most orders.

12. With the range C4:C12 still selected return to Conditional Formatting. Select
Top/Bottom Rules then select Bottom 10 Items.

13. Change the number down to 3 and select Light Red Fill with Dark Red Text.
Click OK. Note the bottom three sales reps who had the least amount of orders.

14. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 37


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Using RELATED


The DAX RELATED function returns a related value from another table. In this
exercise, we want to create a UnitCost column in the DimProducts table that will be
Try It 50% of the UnitPrice. Once the calculated column is created, then we want to be able
to use that UnitCost field in the FactOrderDetails table to create other calculations.

1. In Traders return to the Data Model.

2. Select the DimProducts table. Notice the UnitPrice field. Also, notice there is no
cost field for the products.

3. To create the Cost field, at the end of the field list double-click Add Column and
type UnitCost as the name and press Enter.

4. In the formula bar type the formula =(DimProducts[UnitPrice])*.5 and press


Enter. This will make the cost 50% of the price. Note the values in the new
Calculated Column.

5. Select the FactOrderDetails table. Note the UnitPrice field here. This is
how much was charged for each item, not necessary the standard UnitPrice
that is in the Products table.

6. To display the UnitCost field in the FactOrderDetails table, add a new column
named UnitCost.

7. In the formula create the following formula:


=RELATED(DimProducts[UnitCost]) and press Enter. Note that the UnitCost
from the Products table is now displayed in the FactOrderDetails table.

8. To calculate the Net Profit Per Item which will be the UnitPrice minus the
UnitCost, add a new column named NetProfitPerItem.

9. In the formula bar type the formula as follows:


=FactOrderDetails[UnitPrice]-FactOrderDetails[UnitCost] and press Enter.

10. Click in the UnitPrice field to select it. When the mouse pointer is a four-headed
arrow, drag the UnitPrice column in front of the UnitCost column to see the
difference.

11. To see the Total Profit for the Items Ordered, add a new column named
TotalProfitForItemsOrdered.

12. In the formula bar type the formula as follows:


=FactOrderDetails[NetProfitPerItem]*FactOrderDetails[Quantity].

13. On the Power Pivot Home tab, select PivotTable then PivotTable. Click OK to
create a new worksheet. Name the worksheet tab ProfitPerItemsOrdered.

14. In the PivotTable Fields list, select the FactOrderDetails table and select
TotalProfitForItemsOrdered.

15. Select the FactOrders table and drag the OrderID to the Rows area.

16. Drag the FactOrderDetails ProductID under the OrderID in the Rows area.

© 2022 Online Consulting, Inc., Revised 01/07/22 38


ONLC Training Centers Excel BI Tools Labs and Reviews

17. Select cell B4. Right-click and point to Expand/Collapse then select Collapse
Entire Field.

18. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 39


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Using CALCULATE


The DAX CALCULATE function evaluates an expression in a context that is
modified by the specified filters. For example, =CALCULATE(SUM) allows you to
Try It sum with a condition. In this exercise, we want to calculate the freight for each of
our three shippers: Speedy Express, United Package and Federal Shipping using the
calculate function.

1. In Traders, return to the Data Model.

2. Select the FactOrders table. Note the ShipVia column and the Freight column.
We want to determine how much total Freight was spent on ShipVia 1 (Speedy
Express), ShipVia 2 (United Package) and Ship Via 3 (Federal Shipping).
Therefore, we need three measures.

3. On the Power Pivot Home tab, select PivotTable then PivotTable. Click OK for a
new worksheet.

4. On the Excel Power Pivot tab, select Measures then select New Measure.

5. In the Measure dialog box, select FactOrders as the Table name.

6. Type ShipVia1 as the Measure name.

7. Type Shipper 1 Totals in the Description text box.

8. Click in the formula text box.

9. Click Insert Function and select Calculate.

10. Click Insert Function and select Sum.

11. Type F to bring up the list of Tables and columns that begin with F and double-
click FactOrders[Freight].

12. Close the Sum function with a ) then type , to add the filter.

13. Type F to bring up the list of Tables and columns that begin with F and double-
click FactOrders[ShipVia].

14. Type =1 to select the first shipper then close the calculate formula with a ).
The formula should be:
=CALCULATE(SUM(FactOrders[Freight]),FactOrders[ShipVia]=1)
As a general note, if your calculation is particularly long, you can add extra line
breaks in the Expression Editor by typing ALT-Enter.

15. Click Check formula and note no errors.

16. Select Currency as the Formatting Options Category with a $ symbol and 2
decimal places.

17. Click OK.

© 2022 Online Consulting, Inc., Revised 01/07/22 40


ONLC Training Centers Excel BI Tools Labs and Reviews

18. On the Excel Power Pivot tab, select Measures then select Manage Measures.

19. Select ShipVia1 then click Edit.

20. In the formula area, select the calculate formula. Right-click and select Copy.
Click OK.

21. In the Manage Measures dialog box, click New.

22. In the formula area, right-click and select Paste.

23. Create another measure for Shipper 2 with the following:


Table name: FactOrders
Measure name: ShipVia2
Description: Shipper 2 Totals
Formula: =CALCULATE(SUM(FactOrders[Freight]),FactOrders[ShipVia]=2)
Format as Currency with a $ symbol and 2 decimal places.

24. Create another measure for Shipper 3 with the following:


Fable name: FactOrders
Measure name: ShipVia3
Description: Shipper 3 Totals
Formula: =CALCULATE(SUM(FactOrders[Freight]),FactOrders[ShipVia]=3)
Format as Currency with a $ symbol and 2 decimal places.

25. If modifications are needed to the newly created fields, on the Excel Power Pivot
tab, select Measure then select Manage Measures. Edit the calculations as
needed. Once all 3 calculated measures are correct, click Close.

26. In the PivotTable Fields list, select the DimCustomers table. Select
CompanyName.

27. In the FactOrders table, select ShipVia1, ShipVia2 and ShipVia3, if needed.

28. Note the amount of Alfreds Futterkiste ShipVia2 field as $61.02.

29. Return to the Data Model.

30. In the FactOrders table, sort the ShipName in ascending order by selecting Sort A
to Z for the column drop down list.

31. Note the only Freight for ShipVia for 2 for Alfreds Futterkiste is $61.02.

32. Note the only Freight for ShipVia for 3 for Alfreds Futterkiste is $69.53.

33. Return to Excel and note the Alfreds Futterkiste ShipVia3 value as $69.53.

34. Name the worksheet FreightCostbyShipper.

35. Save the file.

36. From the PivotTable Fields list, expand DimShippers. Select CompanyName.

37. Note the yellow bar with the text Relationships between tables may be needed.
Click Auto-Detect. Once 1 new relationship created is displayed, click Close. If

© 2022 Online Consulting, Inc., Revised 01/07/22 41


ONLC Training Centers Excel BI Tools Labs and Reviews

Auto-Detect does not work, click Manage Relationships. Click New. In the
Create Relationship dialog box, select the Table drop-down list and select Data
Model Table: FactOrders. Select the Column (Foreign) drop-down list and select
ShipVia. Select Data Model Table: DimShipper for Related Table and ShipperID
for the Related Column (Primary) and click OK.

38. Return to the Data Model in Diagram View. Note the new relationship between
FactOrders and DimShippers.

39. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 42


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Using TODAY


The DAX TODAY function returns the current date. As the date changes, the values
will change automatically. In this exercise, we want to determine how many days
Try It since the last time the company placed an order.

1. In Traders return to the Data Model in Data View.

2. Select the FactOrders table.

3. Select the Design tab.

4. In the Calculations group, select Insert Function.

5. In the Select a category drop-down list, choose Date & Time. Select Today. Click
OK.

6. Type a minus symbol (-) then select the FactOrders[OrderDate] field. The
formula will be: =TODAY()-FactOrders[OrderDate]. Press Enter.

7. Change the name for the new calculated column to DaysSinceLastOrder.

8. On the Power Pivot Home tab in the Formatting group, select Decimal Number
for the Data Type.

9. Select Thousands Separated and decrease the decimal places to 0.

10. On the Power Pivot Home tab, select PivotTable then PivotTable. Click OK for a
new worksheet.

11. From the DimCustomers table, select the CompanyName field which gets added
to the Rows area.

12. From the FactOrders table, add the OrderID field to the Rows area below the
CompanyName field.

13. From the FactOrders table, select the DaysSinceLastOrder field which gets added
to the Values area. Note the total number of days for each time the customer
ordered and the customer total.

14. On the PivotTable Tools Design tab in the Layout group, select Subtotals. Select
Do Not Show Subtotals.

15. In the Values area, select Sum of DaysSinceLastOrder. Select Value Field
Settings. Select Min and click OK.

16. Remove the OrderID field from the Rows area. Now note the number of days
since the last time the customer ordered.

17. Save the worksheet tab as DaysSinceLastOrder. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 43


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Using IF
The DAX IF function checks if a condition provided as the first argument is met. It
returns one value if the condition is TRUE, and returns another value if the condition
Try It is FALSE. In this exercise, we want to determine how much commission the sales
reps will receive based on the amount of the Total Price. If the Total Price per item is
over $400, they will receive 15%, otherwise only 5%.

1. In Traders return to the Data Model.

2. Select the FactOrderDetails table.

3. Create a new calculated column named Commission.

4. Click in the formula bar and type if. Double-click the IF function from the drop-
down list.

5. The commission per row will be 15% if the TotalPrice is greater than or equal to
400. Otherwise the commission will be 5%. Type the following formula:
=IF(FactOrderDetails[TotalPrice]>=400,
FactOrderDetails[TotalPrice]*.15,FactOrderDetails[TotalPrice]*.05)
At the end of the formula bar, click the double down arrow icon to expand the
formula bar and view the formula. Press Enter to calculate the formula.

6. On the Power Pivot Home tab, select PivotTable then PivotTable. Click OK for a
new worksheet.

7. From the DimEmployees table, add the FullName field to the Rows area.

8. From the FactOrderDetails table, add the OrderID field to the Rows area below
the FullName field.

9. From the FactOrderDetails table, add the Commission field to the Values area.

10. Select B4. On the PivotTable Tools Analyze tab locate the Active Field group.
Click Collapse Field.

11. Save the worksheet tab as CommissionReport.

12. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 44


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Nesting IF
The DAX IF function can be nested that if the first condition is false, another if
function is evaluated. In this exercise, we want to determine how much commission
Try It the sales reps will receive based on the category ID of the Products.

1. In Traders, return to the Data Model. Select the DimCategories table and note
the 8 categories. The assumption is that category 1 is easier to sell than category
8. That is why the percentages go up with each category.

2. In DimProducts, create a new calculated column named WeightedbyCategory.

3. Click fx on the formula bar to insert a function. Select IF.

4. The formula will be:


=IF(DimProducts[CategoryID]=1,.11,IF(DimProducts[CategoryID]=2,.12,
IF(DimProducts[CategoryID]=3,.13,IF(DimProducts[CategoryID]=4,.14,
IF(DimProducts[CategoryID]=5,.15,IF(DimProducts[CategoryID]=6,.16,
IF(DimProducts[CategoryID]=7,.17,.18)))))))
Press Enter to complete the formula.
Note: Excel will put in the correct number of closing parentheses.

5. Format the column as Percent with 0 decimal places.

6. In FactOrderDetails, add a new column named WeightedbyCategory.

7. The formula for the column will use Related. The formula will be:
=RELATED(DimProducts[WeightedbyCategory]).

8. Format the calculated column as Percent with 0 decimal places.

9. Add a new column named WeightedCommission.

10. The formula will be:


=FactOrderDetails[TotalPrice]*FactOrderDetails[WeightedbyCategory]

11. Format the calculated measure as Currency and 2 decimal places, if needed.

12. Return to Excel.

13. On the CommissionReport worksheet, add from the FactOrderDetails table the
WeightedCommission field to the PivotTable as well as the TotalPrice.

14. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 45


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Using SUMX


The DAX SUMX function returns the sum of an expression evaluated for each row in
a table. In this exercise, we want to show that we can calculated the total price using
Try It a measure instead of a calculated column. Measures are better than calculated
columns because they do not have to be recalculated row by row each time the file is
refreshed like a calculated column does. If you can get the same result with a
Calculated Column or a Measure, use a Measure. Measures take up less space in Data
Model as well as the file size.

1. In Traders in Excel, add a new worksheet. Name the worksheet tab


TotalPriceComparision.

2. On the Insert tab, select PivotTable. Make sure Use this workbook’s Data Model
and Existing worksheet are selected then click OK.

3. On the Power Pivot tab, select Measures then select New Measure.

4. Select FactOrderDetails as the table name.

5. Type TotalPriceMeasure as the Measure name.

6. Type Multiples the UnitPrice by the Quantity in the Description text box.

7. Click fx to insert a function and select SUMX.

8. Instead of creating a calculated column for the TotalPrice, create a measure as


follows:
=SUMX(FactOrderDetails,FactOrderDetails[UnitPrice]*
FactOrderDetails[Quantity]).

9. Click Check formula.

10. Format the measure as Currency and click OK.

11. In the PivotTable field list, select the CompanyName from DimCustomers. In the
FactOrderDetails table, select TotalPrice and TotalPriceMeasure. Note the two
fields provide the same totals, but the TotalPriceMeasure takes up less space in
the Data Model.

12. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 46


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Using DIVIDE


The DAX DIVIDE function performs division and returns alternate result or
BLANK() on division by 0. In this exercise, we want to take the sum of commission
Try It and divide it by the sum of total price to find the commission percent.

1. In Traders in Excel, add a new worksheet. Name the worksheet tab


CommissionPercent.

2. On the Insert tab, select PivotTable. Make sure Use this workbook’s Data Model
and Existing worksheet are selected then click OK.

3. On the Power Pivot tab, select Measures then select New Measure.

4. Select FactOrderDetails as the table name.

5. Type PercentofCommission as the Measure name.

6. In the Description type takes the commission divided by the totalprice.

7. Click fx to insert a function and select DIVIDE.

8. The formula will be:


=DIVIDE(FactOrderDetails[Sum of Commission],
FactOrderDetails[Sum of TotalPrice])

9. Click Check formula.

10. Format the measure as Number with Percentage and 1 decimal place.

11. Click OK.

12. In the PivotTable field list, from the FactOrders table, drag the OrderID in the
Rows area. From the FactOrderDetails table, select TotalPrice and Commission.

13. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 47


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Setting Up a Date Table in Excel 2013


A date table is essential for working effectively with dates and times. The table will
have a list of all the dates from the first date to the last date in the Data Model. If
Try It your sales date range is from 1/1/13 to 12/31/16, a date table will have all those dates
in the first column of the table regardless if any sales were made on any given date.
The following exercise explains how to set up a Date table in Excel 2013.

1. To see an example of a date table, open the file DateTableExample.xlsx in the


student data folder. View the columns. Close the file.

2. Open Traders.xlsx and return to the Data Model.

3. Select the FactOrders table. Select the OrderDate field drop-down arrow and see
the date range from 6/29/13 to 5/4/15.

4. In Excel, create a new workbook.

5. In cell A1, type DateKey as the column heading.

6. In cell A2, type 6/1/13.

7. On the Home tab select Fill, Series. In the dialog box select Series in Columns,
Step Value 1, Stop Value 5/31/15 and click OK. (Or use the Auto Fill handle to
copy the date until you reach 5/31/15).

8. Name the worksheet Calendar.

9. Save the file in the data folder as Calendar. Close the file.

10. In the Trader’s Data Model, select the Home tab. In the Get External Data
group, select From Other Sources. In the drop-down list, select Excel File and
click Next.

11. Click Browse and find the file named Calendar in the Data Folder and click
Open.

12. Select Use first row as column headers. Click Next.

13. Click the Preview & Filter icon to check the data. Click OK.

14. Click Finish. Click Close.

15. To relate the Calendar to the Data Model, click Diagram View.

16. In table FactOrders, select the OrderDate field and drag it to the Calendar
DateKey field.

17. Return to Data View.

18. Select the Calendar table.

19. On the PowerPivot Design tab select Mark as Date Table then Mark as Date
Table. Click OK to have DateKey as the unique identifier.

© 2022 Online Consulting, Inc., Revised 01/07/22 48


ONLC Training Centers Excel BI Tools Labs and Reviews

20. Format the DateKey as date only with the format 3/14/2001.

21. To add the Month column, double-click Add Column and name it Month and
press Enter.

22. Create the calculation =Month(Calendar[DateKey]) and press Enter.

23. Create another column next to it named MonthName.

24. The formula will be =Format(Calendar[DateKey],”mmmm”).

25. To find the Total Price per Month, on the PowerPivot Ribbon Home tab click
PivotTable then PivotTable. Click OK for a new worksheet.

26. Select the MonthName from the Calendar table and add it to the ROWS area.

27. Select the TotalPrice from the FactOrderDetails table. Note the months are in
alphabetical order.

28. Name the worksheet tab SalesbyDate.

29. Return to the Data Model.

30. In the Calendar table, select the MonthName field.

31. On the PowerPivot Ribbon Home tab, in the Sort & Filter group, click Sort by
Column then click Sort by Column.

32. In the dialog box, select MonthName for the Sort column and Month for the By
column and click OK.

33. Return to Excel and notice the order of the months.

34. Save the file.

35. Return to the Data Model.

36. Add a new column named Year.

37. Create the calculation =Year(Calendar[DateKey]) and press Enter.

38. In the SalesbyDate worksheet tab, add Year above Month in the Rows area.

39. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 49


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Setting Up a Date Table in Excel 2016


In Excel 2016, a date table can be created directly in the Data Model. Once created, it
can be modified as desired.
Try It
This exercise only applies to Excel 2016.

1. In Traders, return to the Data Model.

2. If a date table has already setup using the Excel 2013 method, delete the table in
the Data Model.

3. On the Ribbon select the Design tab. Select Date Table then select New. Notice a
Calendar table gets added to the Data Model with a Date, Year, Month Number,
Month, MMM-YYYY, Day of Week Number and Day of Week columns.

4. Click in one of the columns and note the formula that was used to create the
column. Click in each column and review the formula.

5. In the Date column, notice the first date is 1/1/1952 12:00:00 AM. (This is the
oldest date in our Data Model that reflects the earliest Birth Date year in
DimEmployees.) To update the Date column to reflect the dates for the
OrderDates in the Data Model, select the Design tab. Click Date Table and select
Update Range.

6. In the Date Table Range dialog box, change the Start Date to 1/1/2013. Note the
End Date is 12/31/2015. With the date range from 1/1/13 to 12/31/15 this covers
all the dates in the OrderDate field. Click OK.

7. Format the Date column to Data Type of Date with the format of 3/14/2001.

8. To relate the Calendar table to the Data Model, on the Home tab in the Ribbon,
click Diagram View.

9. Drag the Calendar table to the right of the FactOrders table.

10. In the table FactOrders, select the OrderDate field and drag it to the Date field in
the Calendar table. Note the relationship gets created.

11. Expand the Calendar table. Note the Date Hierarchy that has been automatically
created.

12. Return to Data View.

13. Select the Date field in the Calendar table, if necessary.

14. In the Ribbon on the Design tab select Mark as Date Table. Note the Calendar
table has been automatically set to Mark as Date Table since this is checked. This
tells the DAX query engine to use this table for constructing date calculations.

15. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 50


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Working with Date and Time Functions


The real power in Power Pivot comes with successfully creating and using measures.
DAX Time Intelligence functions enable you to manipulate data using date and time
Try It periods; including days, months, quarters, and years, and then build and compare
calculations over those periods.

1. In Traders, return to the Data Model.

2. In the Ribbon on the Power Pivot Ribbon Home tab click PivotTable then
PivotTable. Click OK for a new worksheet.

3. In the PivotTable Fields list, open the Calendar table and select Date Hierarchy
which will get added to the Columns area.

4. Add the DimEmployees FullName field to the rows area. Add the
FactOrderDetails TotalPrice to the Values area.

5. In cell C4, expand 2013 to see the months.

6. Expand July to see the individual dates in July.

7. Collapse July. Collapse 2013.

8. Name the worksheet tab YearlySalesbyRep.

9. Return to the Data Model.

10. In the Calendar table, select the Month field.

11. On the Ribbon on the Home tab in the Sort & Filter group, click Sort by Column
then click Sort by Column.

12. In the dialog box, notice Sort Column is Month and the By Column is Month
Number. This sorts the names of the months in month order (January-December)
instead of alphabetical order (April-September). Click OK.

13. Create a new PivotTable on a new worksheet. On the PivotTable, show for the
employees the sum of Commission by Month.

14. Name the worksheet MonthlyCommission.

15. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 51


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Adding Additional Date and Time Fields


1. In Traders, return to the Data Model.

Try It 2. In the Calendar table, create a calculated column for the WeekNum. The formula
will be =WeekNum(‘Calendar’[Date]).

3. In the Calendar table, create a calculated column for the Quarter. The formula
will be =INT((‘Calendar’[Month Number]+2)/3).

4. Create a new PivotTable showing the FactOrderDetails Quantity by Quarter. Add


the ProductName to the Columns area.

5. Name the worksheet ProductQuarterlySales.

6. Return to the Data Model.

7. Add a new column named FiscalYear.

8. To create the fiscal year beginning in October, enter the following formula:
=IF(’Calendar’[Month Number]<10,’Calendar’[Year],’Calendar’[Year]+1)

9. Add a new column named FiscalQuarter.

10. To create the fiscal quarter beginning in October, enter the following formula:
=IF(‘Calendar’[Month Number]<10,’Calendar’[Quarter]+1,1)

11. Create a new PivotTable that shows the sum of the TotalPrice with FiscalYear
and FiscalQuarter in the Rows area.

12. Name the worksheet FiscalYear.

13. Add a new worksheet. Name the worksheet YTDProfit.

14. On the Power Pivot tab, select Measures, New Measure.

15. Create the following measure:


Table name: FactOrderDetails
Measure name: SumOfProfit
Description: Total Profit for Items Ordered
Formula: =SUM(FactOrderDetails[TotalProfitforItemsOrdered])
Format as Currency with a $ symbol and 2 decimal places.

16. Create another new measure with the following:


Table name: FactOrderDetails
Measure name: YTDProfit
Description: Year to Date Total Profit for Items Ordered
Formula: =TOTALYTD(SumOfProfit),’Calendar’[Date])
Format as Currency with a $ symbol and 2 decimal places.

17. Insert a new PivotTable on the existing worksheet.

18. In the PivotTable Fields list, from the Calendar table select Year and add it to the
Rows area.

© 2022 Online Consulting, Inc., Revised 01/07/22 52


ONLC Training Centers Excel BI Tools Labs and Reviews

19. Add Month from the Calendar table to the Rows area under the Year field.

20. From the FactOrderDetails table, select SumofProfit and YTDProfit.

21. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 53


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating a Power Pivot Report


1. In Traders, return to the Data Model.

Try It 2. On the Power Pivot Home tab, select the PivotTable drop-down list. Select Chart
and Table (Horizontal).

3. In the PivotChart, open the DimEmployees table in the PivotTable Fields list.
Select the FullName field which will go to the Rows area.

4. Select the Distinct Count of OrderID from the FactOrderDetails table.

5. On the Pivot Chart Tools Design tab, change the chart type to a 3-D Pie chart.

6. On the Ribbon, change the Quick Layout of the chart to Layout 1.

7. In the Chart Styles, select a Chart Style 6.

8. Make column B wider so all the names are visually displayed.

9. Change the chart title to Total Orders.

10. On the Ribbon select the PivotChart Tools Analyze tab. In the PivotChart group,
click in the name text box and name the chart EmployeeOrdersChart and press
Enter.

11. In the PivotTable, select the DimEmployees FullName and the FactOrderDetails
Distinct Count of OrderID.

12. Name the PivotTable EmployeeOrdersTable.

13. Rename the worksheet tab EmployeeOrders.

14. In Traders, return to the Data Model.

15. Create a new report on a new worksheet with a PivotChart and PivotTable
(Vertical).

16. In both the PivotChart and the PivotTable, select Employee’s FullName in the
Axis/Rows area, CategoryName in the Legend/Columns area and TotalPrice in
the Values area.

17. Name the PivotChart CategoryChart and the PivotTable CategoryTable.

18. Name the worksheet RepTotalPrice.

19. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 54


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Adding Slicers to a Power Pivot Report


1. In Traders on the RepTotalPrice worksheet, select the chart to make it active.

Try It 2. On the Ribbon select PivotChart Tools Analyze tab.

3. In the Filter group, select Insert Slicer.

4. In the Insert Slicer dialog box, select Category Name and Last Name on the
Active tab. On the All tab, select More Fields under Calendar. Under More
Fields, select Year and Month. Click OK.

5. Make column A wider to a width of 25.

6. Move the Last Name slicer to A3. Slice the slicer to fit in column A.

7. Move the Category Name slicer under the Last Name slicer. Size it as desired.

8. Select the Year slicer. On the Slicer Tools Options tab, change the Columns to 3.
Move the Year slicer to J3.

9. Resize the Month slicer to be 2 columns. Move the Month slicer under the Year
slicer.

10. Select the Month slicer. On the Slicer Tools Option tab, choose one of the Slicer
Styles. Change the Slicer Styles for the other slicers if desired.

11. Select the Month slicer.

12. On the Slicer Tools Option tab, select Report Connections. In the Report
Connections dialog box, select CategoryChart and CategoryTable for the
RepTotalPrice sheet and click OK.

13. Change the Report Connections for the Year, Last Name and Category Name
slicers.

14. In the Last Name slicer, click Fuller. Note the changes to the PivotChart and
PivotTable.

15. In the Last Name slicer, Ctrl-click Peacock to select both Fuller and Peacock.

16. At the top of the Last Name slicer, click Clear Filter to bring back all the
Employees.

17. In cell A1, type Sales by Rep and Category. Format the text as desired. Merge
and Center the title text over cells A1:K1.

18. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 55


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Adding Sparklines


1. In Traders, on the RepTotalPrice worksheet, select cell M20.
Try It
2. On the Excel Ribbon select the Insert tab. Locate the Sparklines group and select
Column.

3. In the Create Sparklines dialog box, select C20:J20. Leave the Location Range
set to M20.

4. Use the Auto fill handle and drag M20 to M29.

5. Click in cell M20.

6. In the Ribbon on the Sparkline Tools Design tab, locate the Show group. Select
High Point and Low Point.

7. In the Ribbon on the Sparkline Tools Design tab, locate the Style group and
select Marker Color. Change the High Point to green.

8. Select the range C20:J28. Use conditional formatting to display any number over
30,000 in a light green fill.

9. Select a cell in the PivotTable. On the PivotTable Analyze tab, select PivotChart.
Select Pie and click OK.

10. Move the Pie chart to the right of the Sparklines. Remove the Chart Title. Add
Data Labels to the Outside End. Size the chart and make it larger.

11. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 56


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Protecting Power Pivot


1. In Traders in Excel, on the Ribbon select the Review tab.

Try It 2. In the Changes group, select Protect Workbook.

3. In the Protect Structure and Windows dialog box, select Structure, if necessary.

4. In the Password text box, type test and click OK.

5. Re-enter the password test again and click OK.

6. On the Ribbon select the Power Pivot tab. Click Manage to go to the data model.
Note the error message. Click OK.

7. Right-click a sheet tab and notice most choices are not available.

8. On the RepTotalPrice worksheet, select a slicer and note it still works. Clear the
filter.

9. On the Review tab, select Protect Workbook.

10. Type in the Password test and click OK.

11. On the Ribbon select the Power Pivot tab. Click Manage to go to the Data Model.

12. Return to Excel.

13. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 57


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Save Reports in Different File Formats


1. In Traders, select the RepTotalPrice worksheet.

Try It 2. Select the File tab and click Print.

3. Change the Orientation to Landscape.

4. Change the paper size to Legal.

5. Change the margins to Narrow.

6. Click Save.

7. Select the File tab and choose Export.

8. Select Create PDF/XPS.

9. Leave the file name Traders and click Publish.

10. View the file then close the Adobe Reader window.

11. Select the File tab and select Save As.

12. Browse to the student data folder.

13. In the Save As dialog box, select the drop-down list for Save as type. Select
Single File Web Page.

14. Leave the File name as Traders and click Save. Click Yes.

15. In Windows Explorer, navigate to the student data folder. Double-click


Trades.mht. Note the worksheet tabs on the bottom. View some of the
worksheets.

16. Close the browser. Close the Traders.mht file.

© 2022 Online Consulting, Inc., Revised 01/07/22 58


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Getting Started with Power Query


In Excel 2013, Power Query is an Add-in. Once installed, a Power Query tab will be
added to the Ribbon. In Excel 2016, Power Query is no longer an add-in. It has been
Try It added to the Data tab in the Get & Transform group. The Power Query exercises are
geared towards Excel 2016. If you have Excel 2013, select the Power Query tab on
the Ribbon instead of the Data tab.

1. Open a blank Excel workbook.

2. On the Ribbon, select the Data tab. In the Get & Transform group, select New
Query.

3. Select From File and choose From CSV. Navigate to the student data folder and
select MonthlySalesData.csv and click Import.

4. Click Edit to open the Query Editor.

5. Reviewing the screen display and Ribbons in the Query Editor. Note the query
name and the three steps in the Applied Steps area of the Query Setting pane
which are automatically created when the file is imported.

6. On the Home tab select Close & Load and choose Close & Load To. Make sure
Table and New worksheet are selected and click Load. Note you are returned to
Excel and the data is now in an Excel table. Also, note the Workbook Queries
pane on the right and the Query tab in the Ribbon.

7. In Excel, return to Sheet1.

8. To see how to load the same data using Excel, on the Data tab in the Get External
Data group, select From Text. Select the MonthlySalesData.csv from the
student data folder and click Import.

9. In the Text Import Wizard make sure delimited is selected. Select My data has
headers and click Next.

10. Select Comma as the delimiter and click Next. Click Finish. Click OK. Note
the data is now placed in the Excel worksheet but not in a table.

11. Return to Sheet2 in the Excel file.

12. Open Windows Explorer and double-click MonthlySalesData.csv.

13. In cell A10, type September. In cell B10 type 5500. Save and click Yes to keep
using that format. Close the file and click Save then click Yes.

14. In the Workbook Queries pane, point to the MonthlySalesData query on the right
and select the Refresh icon. Note that September is now added to the worksheet.

15. Save the file as an Excel workbook named MonthlySalesData. Close the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 59


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Close & Load Data with Power Query


1. In Excel, start with a blank new workbook.

Try It 2. On the Ribbon select the Data tab. In the Get & Transform group, select
New Query. Select From File and choose From Workbook. In the student
data folder select the EmployeeDepts.xlsx file and click Import.

3. Select the EmployeeDepartments worksheet tab. Notice the preview on


the right. Select the drop-down next to Load and select Load to. In the
Load To dialog box, select Only Create Connection and click Load.

4. In the Workbook Queries pane, point to the EmployeeDepartments query


and double-click to open Power Query.

5. Select the Record # field. On the Ribbon on the Home tab in the Manage
Columns group, select Remove Columns then choose Remove Columns.

6. On the Ribbon, click Close & Load and then choose Close & Load to return
to Excel.

7. In the Workbook Queries pane, point to the EmployeeDepartments query


and right-click. Select Load To. In the Load To dialog box, select Add this
data to the Data Model. Click Load.

8. In Excel, save the file to the student data folder and name it Employee
Departments.

9. On the Ribbon, select the Power Pivot tab. Click Manage. Note the data is
now added to the data model.

10. On the Ribbon in the Data Model, select PivotTable, Pivot Table. Click OK
to create a PivotTable on a new worksheet.

11. In the PivotTable Field List, expand the EmployeeDepartments field list.
From the PivotTable field list, select Department and Salary. Note the sum
of salary as $1,277,500 for the Sales Department.

12. Close the file saving the changes.

13. In Excel, open EmployeeDepts.xlsx.

14. Move to the bottom of the list and add information for yourself as a new
employee in the Sales Department with a salary of $100,000.

15. Save and close the file.

16. In Excel open the file Employee Departments.xlsx.

17. In the Security Warning, click Enable Content.

18. On the Ribbon, select the Data tab. In the Get & Transform group, select
Show Queries to display The Workbook Queries pane.

© 2022 Online Consulting, Inc., Revised 01/07/22 60


ONLC Training Centers Excel BI Tools Labs and Reviews

19. In the Workbook Queries pane, point to the EmployeeDepartments query


and click the Refresh icon. Note the increase in the Sales Department’s
Sum of Salary.

20. On the Ribbon, click Power Pivot and select Manage to return to the Data
Model.

21. Scroll to the bottom of the EmployeeDepartments table and note the new
record added to the model.

22. Close the Data Model.

23. Save the Excel file.

24. Close the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 61


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Transforming Data with Power Query


In this lab, we want to make sure all the columns are in the right place, named
appropriate, have the correct information and using the correct data type.
Try It
1. In a new Excel file, select the Data tab on the Ribbon.

2. Click New Query and select From File and choose From CSV. Navigate to the
student data folder and select InvoiceData.csv and click Import.

3. Click Edit to open the Query Editor.

4. In the Query Settings pane, note the three applied steps that automatically were
applied once the data was imported.

5. In the UnitsSold column, click in a cell. On the Ribbon in the Transform group
note the Data Type as Whole Number.

6. In the Applied Steps area, point to the Changed Type and click the X to remove
that step which will remove the data types it automatically applied to the
columns. Note the text on several columns went back to data type Text. Also,
note there is no undo in Power Query.

7. In the Query Settings pane, delete the applied step called Promoted Headers.
This will make the column headers the first row of data in the table. Note the
columns are now called Column1, Column2 and so on.

8. In the Query Settings pane, click the gears icon to the right of the Source step to
see the settings of how the CSV file import information. Click Cancel.

9. To get the first row back as column headers, on the Home tab in the Transform
group, select Use First Row as Headers. Note the column headers are back in the
Query Editor and the step Promoted Headers is added to the Applied Steps in the
Query Settings pane.

10. In the Query Editor, drag the ProductName column header in front of the
SalesDate column to move the column. Drag the SalesValue column in front of
the UnitsSold column. In the Applied Steps pane, note the new step Reordered
Columns.

11. Right-click the column heading InvoiceNumber and select Rename. Add a space
between the two words to make it Invoice Number as the column heading.

12. Double-click the ProductName heading and add a space between the two words
to make it Product Name. Do the same for the remaining columns. In the
applied steps pane, note the new step Renamed Columns.

13. Select the Sales People column. To make Sales People two columns, on the
Ribbon on the Home tab in the Transform group, click Split Column and choose
By Delimiter.

14. In the Split Column by Delimiter dialog box, make sure Comma is select as well
as At each occurrence of the delimiter. Click Advanced options and note it will
make it 2 columns. Click OK.

© 2022 Online Consulting, Inc., Revised 01/07/22 62


ONLC Training Centers Excel BI Tools Labs and Reviews

15. Rename the columns to Sales Person 1 and Sales Person 2.

16. Select the Sales Person 1 column and ctrl-click the Sales Person 2 column. To
change the text to be consistent, right-click and point to Transform and choose
Capitalize Each Word. Note the names are all consistent with first letter being
capitalized and the rest lower case.

17. Select the Ship To City column. From the column drop-down list, select Sort
Ascending.

18. Select the Ship To Country column. From the column drop-down list, select Sort
Descending.

19. To fill in the missing Countries using the data from the cell above to fill the blank
cell below, select the Ship To Country column. On the Ribbon on the Transform
tab in the Any Column group, select Fill and choose Down. Note the Countries
were not added to the blank cells because fill will only fill cell that contain the
word null.

20. Select the Ship To Country column. On the Ribbon in the Any Column group,
select Replace Values. In the Replace Values dialog box, leave the Values to
Find text box blank. In the Replace With text box, type null. Click OK.

21. To fill in the missing Countries, on the Ribbon on the Transform tab in the Any
Column group, select Fill and choose Down. Note now the countries are filled in
with the value from the cell above.

22. Select the Ship To City. To duplicate this column, on the Ribbon select the Add
Column tab. In the General group, click Duplicate Column. Note the added Ship
To City - Copy column.

23. Select the Ship To Country and duplicate this column.

24. Select the Ship To City - Copy column and ctrl-click the Ship To Country –
Copy column. To make this one column named Ship To Address separated by a
comma, on the Ribbon on the Transform tab in the Text Column group select
Merge Columns.

25. In the Merge Columns dialog box, choose Comma as the Separator. Type Ship
To Address in the New column name (optional) text box and click OK.

26. Select the Ship To Address column. To add a space after the comma, on the
Ribbon in the Any Column group select Replace Values.

27. In the Replace Values dialog box, type just a , (comma) in the Value to Find text
box. In the Replace With text box, type a , (comma) followed by a space. Click
OK.

28. Select the Invoice Number column. To change the data type of this column to a
whole number, right-click and select Change Type and choose Whole Number.
Note the Error message since one of the items is not a number because of the
word Invoice.

29. In the Applied Steps pane, remove the Changed Type1 step.

© 2022 Online Consulting, Inc., Revised 01/07/22 63


ONLC Training Centers Excel BI Tools Labs and Reviews

30. To remove the word Invoice from the field, select the Invoice Number column.
Right-click and select Replace Values.

31. In the Replace Values dialog box, type Invoice in the Value To Find text box.
Leave the Replace With text box empty. Click OK. Note the word Invoice is
gone.

32. With the Invoice Number column still selected, change the data type to Whole
Number and notice no error message. Since we will never calculate on the
Invoice Number column, in the Applied Steps, remove the Changed Type1 step.

33. Change the Sales Value and Shipping Cost columns to the Currency data type.
Note the values don’t change. This will get fixed in Excel.

34. In the Query Editor, note that there are two rows with the Invoice Number 129
with the same information in the other columns. To delete the duplicate row,
click the upper left corner in the Query Editor. From the shortcut menu, select
Remove Duplicates. Note now there is only one row with Invoice Number 129.

35. To put this cleaned up data in Excel, on the Home tab select Close & Load then
select Close & Load To. Make sure Table and New worksheet are both selected
and click Load. Note the data is placed on a new worksheet as a table.

36. In Excel on the Ribbon select the Data tab. In the Connections group, click
Properties. In the External Data Properties dialog box, select Preserve column
sort/filter/layout, if necessary, and click OK. This will keep the columns
formatted after a Refresh.

37. Select the Sales Value and Shipping Cost columns. Format the columns as
Currency.

38. Save the workbook as Invoice Data from Power Query.

39. In the Query pane on the right, point to the Query and click Edit to return to the
Query Editor. Note that all the steps are listed in the Applied Steps area.

40. On the Ribbon click Close & Load then Close & Load to return you to Excel.

41. Save the file. Close the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 64


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Appending Data with Power Query


In this lab using Power Query we will be able to take data from three different file
types (Access, Excel and Text) and put all the data into one table.
Try It
1. Open Windows Explorer and select the student data folder.

2. In the folder list, open NewYorkSales.accdb. Double-click the NewYorkSales


table to open it. Review the data and note there are 2569 records in the table.
Close the file.

3. In the folder list, open PhiladelphiaSales.txt. Review the data. This file has 153
rows of data. Close the file.

4. In the folder list, open BaltimoreSales.xlsx. Review the data and note there are
2569 entries in the table. Close the file saving the changes.

5. In Excel, create a new file.

6. Select the Data tab. In the Get & Transform group, click New Query. Select
From Database then select From Microsoft Access Database.

7. In the Browse dialog box, navigate to the student data folder and select the
NewYorkSales.accdb file and click Import.

8. Right-click on the NewYorkSales table and select Edit. If necessary, click


Refresh in the yellow bar.

9. Select the ID column. On the Home tab of the Ribbon, select Remove Columns
and then choose Remove Columns to delete this column from the table since the
other data sources do not have this column.

10. Select the Date column. On the Home tab of the Ribbon, select Data Type and
choose Date.

11. On the Home tab, select Close and Load and then choose Close and Load To.
Select Only Create Connection and click Load.

12. In Excel, select the Data tab. In the Get & Transform group, select New Query
then click From File and select From Text.

13. In the Browse dialog box, navigate to the student data folder and select the
PhiladelphiaSales.txt file and click Import.

14. Click Edit to open the Query Editor.

15. View the data and note it looks the same as the New York Sales table.

16. On the Home tab select Close and Load and then choose Close and Load To.
Select Only Create Connection and click Load.

17. Select the Data tab. In the Get & Transform group, select New Query then click
From File and select From Workbook.

© 2022 Online Consulting, Inc., Revised 01/07/22 65


ONLC Training Centers Excel BI Tools Labs and Reviews

18. In the Browse dialog box, navigate to the student data folder and select the
BaltimoreSales.xlsx file and click Import.

19. Right-click the BaltimoreSales table and click Edit.

20. View the data and notice it looks like the other two tables.

21. On the Home tab, select Close and Load and then choose Close and Load To.
Select Only Create Connection and click Load.

22. With the three queries listed in the Workbook Queries pane, on the Ribbon select
the Data tab. In the Get & Transform group, select New Query. Point to
Combine Queries and select Append.

23. In the Append dialog box, select Three or more tables. Select BaltimoreSales
and click Add. Add PhiladelphiaSales and NewYorkSales as the tables to
append and click OK.

24. In the Query Settings pane, type AllSalesCombined as the query name and press
Enter.

25. On the Home tab, select Close and Load and then choose Close and Load To.
Select Only Create Connection. Select Add this data to the Data Model. Click
Load.

26. Save the Excel file as AllSalesData.

27. On the Ribbon select the Power Pivot tab and choose Manage. Notice the data
added to the data model as one table with a total of 5,291 records. The
NewYorkSales table had 2569 records, the PhiladelphiaSales table had 153 and
the BaltimoreSales table had 2569 records.

28. On the Home tab of the Power Pivot Ribbon, select PivotTable, PivotTable and
create a PivotTable on a new worksheet.

29. From the AllSalesCombined list, select Product and Units.

30. Save and close the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 66


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Merge Data with Power Query


In this lab using Power Query we will be able to take data from one table and add
additional columns to another table based on a common field. This will be like a
Try It VLOOKUP function in Excel.

1. Open Windows Explorer and select the student data folder.

2. In the folder list, open Transactions.xlsx file. Review the data and notice the
Product-ID column with data as QU-G83911-DN for example. Close the file.

3. In the folder list, open Products.txt. Review the data and notice the Product-ID
as QU-G83911. Close the file.

4. In Excel, create a new file.

5. Select the Data tab. In the Get & Transform group, select New Query then click
From File and select From Workbook.

6. In the student data folder select the Transactions.xlsx file and click Import.

7. Right-click the Transactions table and click Edit.

8. Select column for Product-ID.

9. On the Home tab in the Transform group, click Split Column and choose By
Delimiter.

10. In the Split Column by Delimiter dialog box, select Custom from the delimiter
type. Type a – as the delimiter. Select At the right-most delimiter and click OK.
Notice the two Product ID columns.

11. Right-click the Product-ID.2 column and click Remove.

12. Rename Product-ID.1 column to Product-ID.

13. Right-click the Invoice Number column and click Remove.

14. Name the query FactTransactions and press Enter.

15. Select Close and Load and then Close and Load To. Select Only Create
Connection and click Load.

16. From the Data tab select New Query then select From File and choose From
Text. Select the Products.txt file and click Import.

17. Click Edit to open the Query Editor.

18. Click the upper left corner of the table and select Use First Row as Headers.

19. In the Query Settings Name box change the name to DimProducts and press
Enter.

20. Select Close and Load and then Close and Load To. Select Only Create
Connection and click Load.

© 2022 Online Consulting, Inc., Revised 01/07/22 67


ONLC Training Centers Excel BI Tools Labs and Reviews

21. In the Workbook Queries pane, right-click FactTransactions and select Merge.

22. In the first drop-down, make sure FactTransactions is the selected table. Click
the Product-ID column.

23. In the second drop-down, select the DimProducts table. Click the Product-ID
column.

24. Make sure the Left Outer join is selected and click OK.

25. In the Query Editor, click the drop-down for the NewColumn. Clear the
check for (Select All Columns) and only check Product and Company. Click
OK. This will create two new columns as if it just did a VLOOKUP.

26. Rename the column heading NewColumn.Product to Product.

27. Rename the column heading NewColumn.Company to Company.

28. Remove the column Product-ID since it was only needed for the lookup and it is
no longer needed in our model.

29. In the Query Settings Name box change the name to SalesandCostTable and
press Enter.

30. Select Close and Load and then Close and Load To. Select Only Create
Connection. Select Add this data to the Data Model and click Load.

31. Save the file as SalesandCostTable.

32. Select the Power Pivot tab and click Manage. Note the table added to the data
model.

33. Select the Date field and change the format to Date only showing the date.
Adjust the column width if necessary.

34. Select the Net Sales and Cost columns and change the format to Currency. If an
error message displays move to another column, then come back and try it again.
It will eventually format the cells as currency.

35. On the Home tab, select PivotTable, PivotTable on a New Worksheet and click
OK.

36. Select the Power Pivot tab. In the Calculations group select Measure and choose
New Measures.

37. The table will be SalesandCostTable. The Measure name is Net Profit.

38. The formula should be:


=SUMX(SalesandCostTable,SalesandCostTable[NetSales]-
SalesandCostTable[Cost])

39. Format the field as currency, $ with 2 decimal places and click OK.

40. In the PivotTable field list, select Product for the Rows area. Net Profit will be in
the Values area.

© 2022 Online Consulting, Inc., Revised 01/07/22 68


ONLC Training Centers Excel BI Tools Labs and Reviews

41. On the PivotTable Tools Analyze tab, select Insert Slicer. Select Company and
click OK. Size and format the slicer as desired.

42. Test the different companies in the slicer.

43. Save and close the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 69


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Getting Started with Power Map


In this lab, we will look at the Power Map interface.

Try It 1. In Excel, open PowerMap1.xlsx. Click Enable Content, if necessary.

2. On the Ribbon on the Power Pivot tab, select Manage to view the data model.

3. Note the two tables in the model. Also, note the State field.

4. Close the Data Model.

5. Select the File tab and click Options. Select Add-Ins. Open the Manage: drop-
down list and select COM (Component Object Model) Add-ins and click Go.

6. If necessary, select Microsoft Power Map for Excel and click OK.

7. On the Ribbon on the Insert tab in the Tours group, select 3D Map. Click Open
3D Maps to launch Power Map.

8. On the screen, note the Tour Editor pane on the left, the Power Map designer in
the middle and the Layer pane on the right. In the Layer pane, there is Data,
Filters and Layer Options. Also, the Field List pane that contains the tables and
fields from the Data Model.

9. To rename Layer 1, click the pencil icon to the right of Layer 1. In the text box
type Energy Type and press Enter.

10. In the PowerStations table in the Field List pane, select State and drag it to the
Location box. Note state is added and the map shows the states.

11. Select PlantCount and drag it to the Height box.

12. Select Energy Description and drag it to the Category box.

13. In the Layer pane, select the Clustered Column chart icon to change the chart
type.

14. On the Ribbon on the Home tab in the Map group, click Map Labels to display
the state names.

15. In the designer area in the right corner of the map, use the + to zoom in. Shift the
map to the California area. Use the arrow keys to rotate and tilt the map. Spin
the map around to see Alaska and then Hawaii. Return to the California area.

16. On the upper right click File and select close. This will close the Power Map and
take you back to Excel.

17. Save the Excel file.

© 2022 Online Consulting, Inc., Revised 01/07/22 70


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Adding Another Layer


1. On the Ribbon on the Insert tab, select 3D Map and then choose Open 3D Maps.

Try It 2. Click Tour 1 to return to the previous Map.

3. In the Layer pane on the right, click the Add Layer.

4. Name the Layer CO2 Emissions and press Enter.

5. In the StateCO2Emissions field list, select State and drag it to Location.

6. In the field list, select CO2 Emissions and drag it to Height.

7. In the Layer pane on the bottom, select Layer Options.

8. Select the CO2 Emissions color drop-down list and change it to Deep Red.

9. Zoom in closer and note the color change. Change the color to black.

10. In the Layer pane in the Formatting area change the Thickness to 200%.

11. Try some other formatting options.

12. Close Power Map.

13. Save and close the Excel file.

© 2022 Online Consulting, Inc., Revised 01/07/22 71


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Using Multiple Scenes with Power Map


1. In Excel, open the file PowerMap2. If displayed, click Enable Content.

Try It 2. On the Ribbon select the Power Pivot tab and click Manage. In the Data Model
notice the two tables for HurricaneBelle and HurricaneSandy. Note the
latitude and longitude fields. Review the data and close the Data Model.

3. On the Ribbon on the Insert tab, select 3D Map. Click Open 3D Maps.

4. Rename Layer 1 to HurricaneBelle.

5. In the HurricaneBelle field list, select Latitude and drag it to the Location box.
Drag Longitude to the Location box under Latitude.

6. Change the chart type to a Heat Map.

7. Select Wind Strength as the Value field.

8. Select DateTime as the Time field.

9. In the designer area, click the Play arrow and watch the hurricane’s path.

10. On the Ribbon select New Scene and choose World Map.

11. In the pane on the right, name Layer 1 Hurricane Sandy.

12. In the HurricaneSandy field list, select Latitude and Longitude for Location.

13. Change the chart type to a Heat Map.

14. Select Wind Strength as the Value field.

15. Select DateTime as the Time field.

16. In the designer area, click the Play arrow and watch the hurricane’s path.

17. On the Ribbon in the Tour group, select Play Tour. This will make a full screen
map and play one scene after the other. When finished, press Esc.

18. In the Tour pane, select Scene 1. Click the gear icon to open the scene options
dialog box.

19. Type HurricaneBelle as the Scene Name.

20. Change the scene duration to 15 seconds.

21. Select the Effect drop-down list and select Push In.

22. Close the Scene Options window.

23. On the Ribbon select Play Tour. Note that the scene plays longer and had the
Push In effect. Press Esc.

© 2022 Online Consulting, Inc., Revised 01/07/22 72


ONLC Training Centers Excel BI Tools Labs and Reviews

24. Make sure Scene 1 is selected. On the Ribbon in the Map group, click Map
Labels.

25. In the Tour pane, select Scene 2 and click the gear to change the scene options.

26. Change the Scene duration to 20 seconds. Name the Scene Hurricane Sandy.
Select the Dolly Effect. Close the Scene Options window.

27. On the Ribbon in the Map group, click Map Labels.

28. On the Ribbon, select Themes and select a theme.

29. On the Ribbon select Play Tour. Press Esc.

30. On the Ribbon select Create Video.

31. In the create video dialog box, select Computers & Tablets.

32. Click Create. Name the video Hurricanes and save it in the student data folder.

33. When completed appears in the Creating Video dialog box, select Open.

34. View the video. Close the video window.

35. Close the Power Map window.

36. Save the Excel file.

37. Open the Data Model.

38. Import an Excel file named Hurricane Floyd.xlsx. Make sure to select Use first
row as column headers. Once the import is complete, note the new table added.

39. Close the Data Model.

40. Save the Excel file.

41. On the Ribbon on the Insert tab, select 3D Map. Click Open 3D Maps and select
the existing tour.

42. On the Ribbon select New Scene and choose World Map. Make sure Scene 3 is
between Hurricane Belle and Hurricane Sandy.

43. In the Layer Pane, name Layer 1 Hurricane Floyd.

44. In the HurricaneFloyd field list, select Latitude and Longitude for Location.

45. Change the chart type to a Heat Map.

46. Select Wind Strength as the Value field.

47. Select DateTime as the Time field.

48. In the designer area, click the Play arrow and watch the hurricane’s path.

© 2022 Online Consulting, Inc., Revised 01/07/22 73


ONLC Training Centers Excel BI Tools Labs and Reviews

49. Select the scene in the Tour pane and click the gear icon. Name the scene
Hurricane Floyd and change any other options as desired. Close the scene
options window.

50. On the Ribbon in the Tour group, select Play Tour. This will make a full screen
map and play one scene after the other. When finished, press Esc.

51. Close Power Map.

52. Save and close the Excel file.

© 2022 Online Consulting, Inc., Revised 01/07/22 74


ONLC Training Centers Excel BI Tools Labs and Reviews

© 2022 Online Consulting, Inc., Revised 01/07/22 75


ONLC Training Centers Excel BI Tools Labs and Reviews

Overview of Power BI Desktop


Since Microsoft eliminated the ability to create Power View visualizations in Excel
Try It (October 2021), their intention now is to use Power BI Desktop to create the
visualizations. Since the Power BI Desktop tool is free, it can be downloaded to as
many computers as necessary. This exercise opens an existing Power BI Desktop file
to give an overview of the product.

1. To install Power BI, go to www.powerbi.com website. Scroll to the bottom and


under Downloads, select Power BI Desktop. Click Download Free and follow the
screen prompts.

2. If Power BI Desktop is already installed, click Start and select Power BI


Desktop.

3. From the Welcome screen, select Open other reports and navigate to the student
data folder. Select Retail Analysis Sample PBIX file and click Open.

4. When the file is opened, view the screen display.

5. On the bar on the left, click Data. Note the tables in the Fields pane on the right.
Expand a table to see the columns of data.

6. On the bar on the left, click Model to see the relationships between the tables.

7. On the bar on the left, click Reports to return to the visualization pages.

8. On the bottom left, click the Overview page.

9. Note the different visuals.

10. Click the District Monthly Sales page then the New Stores page and note the
visuals.

11. On the right, note the Filters, Visualizations and Fields panes used to create
visualizations.

12. In the upper right, click Close to close Power BI Desktop.

© 2022 Online Consulting, Inc., Revised 01/07/22 76


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Getting Started with Power BI


The next few exercises will take an Excel table into Power BI Desktop and make
Try It modifications as needed to create visualizations on a report.

1. Open Excel.

2. Open the Financial Sample file from the student data folder.

3. Note the data is in an Excel table.

4. Close Excel.

5. Open Power BI Desktop.

6. From the Welcome screen, select Get data.

7. From the Get Data dialog box, select Excel Workbook and click Connect.

8. Navigate to the student data folder and select Financial Sample and click Open.

9. In the Navigator, check the financials table.

10. Click Transform Data.

11. In the Power Query Editor, right-click the Units Sold column. Point to Change
Type and choose Whole Number. Click Replace current.

12. On the Home tab, click Close & Apply.

13. In the Fields pane on the right, expand the financials table to see the fields. Note
the Sigma symbol in front of the Sales column and some other columns to
indicate those fields as numeric. Also note the calendar symbol in front of the
Date field.

14. On the Home tab of the Ribbon, click File and choose Save as.

15. Navigate to the student data folder. Name the file Financials and click Save.

© 2022 Online Consulting, Inc., Revised 01/07/22 77


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating Measures


1. On the Home tab of the Ribbon in the Power BI Desktop, select New measure.
Try It
2. To create a measure to sum up all the numbers in the Units Sold column, in the
formula bar type Total Units Sold=SUM(financials[Units Sold]) and press Enter.

3. On the right in the Fields pane, note the new field Total Units Sold with a
calculator icon to indicate it is a measure.

4. On the bar on the left, select Data.

5. To create a new Calendar table with the dates between January 1, 2013 and
December 31 2014, on the Home tab of the Ribbon click New table.

6. In the formula bar, type


Calendar=CALENDAR(DATE(2013,01,01),DATE(2014,12,31)) and press
Enter.

7. Click in the new Date column to make it active.

8. On the Column tools tab of the Ribbon, select the Format drop-down list and
select *3/14/2001 (Short Date).

9. On the bar on the left, select Model.

10. To link the Calendar table to the financials table, from the financials table drag
the Date field to the Date field in the Calendar table. Note the one to many
relationship.

11. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 78


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating Visualizations with Power BI Desktop


1. On the bar on the left, click Report.
Try It
2. On the Ribbon, click the Insert tab. Select Text box to create a title for the
report.

3. Type Financial Summary Report.

4. Select the text and format it as bold and the font size as 20 points.

5. Shorten the text box and make sure the text fits on one line.

6. Save the file.

7. Click in a blank space in the canvas to deselect the title text box.

8. To create a line chart to show the profit by month and year, from the Fields pane
on the right, expand the financials table, if needed.

9. Drag the Profit field to a blank area on the report canvas. A default column chart
is added.

10. From the Fields pane on the right, expand the Calendar table, if necessary.

11. Drag the Date field to the column chart.

12. In the Visualizations pane, click Fields, if necessary.

13. Select the Axis drop-down list and select Date.

14. In the Visualizations pane, click Line chart.

15. Drag the line chart up and place it under the title text box so the left side of the
line chart begins under the word Report. Size the chart to be about one third of
the size of the canvas.

16. To create a Map chart to show which countries have the highest profit, drag the
Country field to a blank area on the canvas.

17. Drag the Profit field into the Map. Note the size of the bubbles changes based on
the profit.

18. Collapse the Filters pane.

19. Drag the Map chart to the right of the Line chart, if necessary. Size it to fill the
rest of the canvas to the right.

20. Save the file.

21. To create a Matrix to show the Total Profit by Product and Segment, drag the
Profit field to a blank area of the canvas.

© 2022 Online Consulting, Inc., Revised 01/07/22 79


ONLC Training Centers Excel BI Tools Labs and Reviews

22. In the Visualizations pane, click Matrix.

23. Drag the Product field to the Rows area in the Visualization pane.

24. Drag the Segment field to the Columns area in the Visualization pane.

25. Drag the Matrix below the line chart but to the left edge of the canvas. Size it
wide enough to see the Total column.

26. To create a Pie chart to show the Total Units Sold by Country, drag the Country
field to a blank area of the canvas to the right of the Matrix.

27. In the Visualizations pane, click Pie chart.

28. Drag the Total Units Sold to the Pie chart.

29. Drag the Pie chart to the right of the Matrix and size it to fill the space.

30. To create a slicer to filter the visualizations, from the Calendar table, drag the
Date Hierarchy field to the blank area on the left of the canvas under the title.

31. In the Visualizations pane, click Slicer.

32. In the Visualizations pane, remove the Month and Date fields so only the Year
and Quarter fields remain.

33. In the Slicer, click a year and watch the other visualizations change.

34. In the Slicer, select a quarter.

35. On the top right of the Slicer, click Clear selections.

36. Size any visualizations as needed.

37. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 80


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Formatting Visualizations with Power BI Desktop


1. In the Power BI Desktop report, select the Line chart.
Try It
2. In the Visualizations pane, click Format.

3. Expand Data colors. Change the Profit line to a color of your choice.

4. Expand Shapes. Increase the Stroke width to 6 and note the thickness of the line
increases.

5. Select the Matrix. Expand Field formatting. Type 0 in the Value decimal places.

6. For the Column headers, Row headers and Values, change the Text size to 11.

7. Select the Pie chart. Decrease the Legend Text size to 9.

8. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 81


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Filtering Visualization in Power BI Desktop


1. In the Power BI Desktop report, select the Map visualization.
Try It
2. Expand the Filters pane, if necessary.

3. In the Filters pane, point to the Country field and select the drop-down list.

4. Select only Canada and United States of America. Note the Map shifts and only
those two countries are shown.

5. Collapse the Filters, Visualizations and Field panes.

6. Save the file.

The final report should like similar to this example:

© 2022 Online Consulting, Inc., Revised 01/07/22 82


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Importing an Excel Data Model in Power BI Desktop


A Data Model created in Excel can to be imported into Power BI Desktop to create
Try It visualizations. This exercise will use the Traders data model created during class.

1. In Excel, open the Traders final after class.xlsx data model file.

2. View the Power Pivot data model.

3. Return to Excel.

4. View the TotalbyYear, TotalbyMonth, KPI, and Category worksheet tabs.

5. Close the file.

6. If the Power BI Desktop tool is open, close the application. Note there is no way
to close a file without closing the application.

7. Open Power BI Desktop.

8. Close the welcome window.

9. Open the File Tab and choose Import.

10. Select the Power Query, Power Pivot, Power View option.

11. Navigate to the student data folder, if necessary. Select the Traders final after
class.xlsx file and click Open.

12. In the message “Import Excel workbook contents” window, click Start.

13. If the message Import Excel workbook contents window displays referencing the
worksheet table, DimEmployees, click Keep connection.

14. In the Import Excel workbook contents window, when the message says,
Migration completed, click Close.

15. To make the canvas page larger, in the Filters pane on the right, click Collapse or
expand the filter pane while editing.

16. In the Fields pane on the right, note the table list we previously saw in Excel.

17. Expand the DimCategories table. Note the fields from the original table
imported in Power Pivot, such as Category ID. do not have an icon in front of
them.

© 2022 Online Consulting, Inc., Revised 01/07/22 83


ONLC Training Centers Excel BI Tools Labs and Reviews

18. Expand the FactOrderDetails table. Note every measure, calculated column,
KPI, hierarchy, etc. converted over when importing the data model. The table
below identifies the icons displayed in front of a field:

Icon Description

Numeric field

Measure

Calculated column with a numeric data type

Calculated column with a non-numeric data type

KPI

Hierarchy

Geo data

Calendar date field

19. Click the Data icon on the far left. This view will display the data for the
selected table.

20. Click the Model icon on the far left. In the properties pane on the right, click
Show/hide pane to collapse the pane. Click the Fit to screen icon in the bottom
right corner to see the entire data model. This view will show the relationships
between the tables.

21. Click the Report icon on the far left to return to the report canvas.

© 2022 Online Consulting, Inc., Revised 01/07/22 84


ONLC Training Centers Excel BI Tools Labs and Reviews

Lab - Creating Visualizations in Power BI Desktop


We will replicate several report that were created in the Excel Data Model to show
Try It how the process works in Power BI Desktop.

1. To replicate the TotalByYear report, in the visualizations area click Matrix. The
closest equivalent to a PivotTable Report in Power BI is a Matrix. Note the wells
(placeholders) in the Visualizations pane under Fields resemble those in Excel
with Rows, Columns, and Values.

2. Expand the Calendar table. Select Month which will default to the Rows well.

3. In the Calendar table, select Year and it will default to the Columns well.

4. Expand the FactOrderDetails table and select the SumofTotalPrice measure. The
measure will go to the Values well by default.

5. In the canvas, select the bottom-right corner of the matrix. With the cell pointer
as a double-header arrow, click and drag down and to the right to make the visual
large enough to see all the values.

6. Click in a blank area of the canvas to deselect the matrix.

7. To replicate the TotalByMonth report, expand the Calendar table, if necessary.


Select MonthName. Power BI will automatically create a Table and place
MonthName in the Values well.

8. Expand the FactOrderDetails table and select the SumofTotalPrice measure. The
measure should also go to the Values well by default.

9. In the canvas, size the table area to fit the two columns.

10. Click in a blank area of the canvas to deselect the table.

11. To replicate the KPI report which was a PivotTable report in Excel with KPI
status indicators, expand the DimProducts table and select ProductName. Power
BI will automatically create a Table and place ProductName in the Values well.

12. Expand the FactOrderDetails table. Expand the Sum of TotalPrice 2 KPI. Select
Value and Status.

13. Resize the table to see the value and status indicators.

14. Select the File tab and choose Save as. Name the report Traders.pbix and save
it to the Desktop.

15. On the bottom left of the screen, click New page to add a second page to the
report.

16. To replicate the Category report, expand the FactOrderDetails table and select the
SumofTotalPrice measure. The measure should also go to the Values well by
default. The visualization will default to a Clustered column chart.

© 2022 Online Consulting, Inc., Revised 01/07/22 85


ONLC Training Centers Excel BI Tools Labs and Reviews

17. Expand the DimEmployees table and select FullName. It will default to the Axis
well.

18. Expand the DimCategories table and select the Category Name. It should default
to the Legend well.

19. Resize the chart’s height and width to fill the top half of the page.

20. Click in a blank area on the canvas to deselect the Chart.

21. Expand the DimEmployees table and select FullName. It should default to the
Values well in a Table.

22. Expand the DimCategories table and select Category Name. It should default to
the Values well.

23. Expand the FactOrderDetails table and select the SumofTotalPrice measure. The
measure should also go to the Values well by default. Note that the table has
limited space to display all the employees.

24. To change the visual to a Matrix, in the visualizations pane, click the Matrix
icon. Notice all the data displays now summarized by Category Names.

25. Resize the Matrix width to fit on the left leaving some space to the right.

26. Click in a blank area on the canvas to deselect the Matrix.

27. In the Visualizations pane, choose the Slicer icon.

28. Expand the DimCategories table and select Category Name.

29. Move the Slicer to the right of the Matrix. Resize the slicer as desired.

30. Click on a category name in the slicer and notice both visuals automatically
display only the corresponding data. Clear the slicer by clicking the same
selection again.

31. In the Matrix, click on a Category Name heading. This time, the visualizations
respond by highlighting corresponding data for a comparison view. In Excel we
had to manually force slicers to connect to multiple visuals in a report but here, it
is the default.

32. Click on the column heading again to return all the categories.

33. To apply conditional formatting, make sure the Matrix is active.

34. In the Visualizations pane in the Values well, click the down-down arrow next to
Sum of TotalPrice. Point to Conditional formatting then select Background color.

35. In the Background color dialog box, select the Format by drop-down list and
select Rules.

36. Change If value to is greater than. Change the 0 in minimum text box to 30,000.
Change Percent to Number.

© 2022 Online Consulting, Inc., Revised 01/07/22 86


ONLC Training Centers Excel BI Tools Labs and Reviews

37. To the right of and, ensure the selection of less than and enter the number
100,000 for the maximum, then change Percent to Number. if needed.

38. After then, select the color drop-down list and choose a light color.

39. Click OK. Note the values between 30,000 and 100,000 are now displayed in
color.

40. Select the chart.

41. In the Visualizations pane, click Format.

42. Expand the Legend. Change the Position to Bottom.

43. Expand the Title. Change the title text to Total Price by Rep and Category.
Change the Alignment to Center. Increase the Text size to 16 pt.

44. Select the Matrix. Change the Style to Bold header. Turn the Vertical grid on.

45. Select the Slicer. Change the Background to a light color.

46. Make any other changes as desired.

47. Save the file.

48. Close Power BI.

The final report should like similar to this example:

© 2022 Online Consulting, Inc., Revised 01/07/22 87


ONLC Training Centers Excel BI Tools Labs and Reviews

Excel BI Tools Review 1 Lab


1. Open Windows Explorer and Navigate to the student data folder.
Try It
2. Double-click AgentInfo.txt to open the file and view the data. Close the text file.

3. Double-click LeapsAndBounds.accdb and view the tables. Close the file.

4. Double-click Destinations.xlsx to open the file and view the data.

5. Select cell A1. On the Ribbon select the Insert tab. In the Tables group click
Table. Verify the range A1 through E129. Make sure My table has headers is
selected. Click OK.

6. Select cell A1. On the Ribbon select the Table Tools Design tab. In the Properties
group click in the Table Name text box. Type Destinations and press Enter.

7. On the Ribbon select the Power Pivot tab. In the Tables group, click Add to Data
Model. Note the Destinations tab in the lower left with the link icon.

8. To import a Text file, on the Ribbon on the Data Model Home tab in the Get
External Data group, select From Other Sources. Scroll down and select Text
File. Click Next.

9. Click Browse and navigate to the student data folder and select AgentInfo and
click Open.

10. Set the Column Separator to Space (). Make sure Use first row as column headers
is selected. Click Finish.

11. In the Table Import Wizard dialog box, note the success of the imported data.
Click Close. Note the tab in the lower left named AgentInfo.

12. To import Access table, on the Ribbon on the Data Model Home tab, select From
Database. Choose From Access.

13. In the Table Import Wizard, click Browse. Select the LeapsAndBounds file from
the student data folder and click Open. Click Next.

14. Make sure Select from a list of tables and views to choose the data to import is
checked and click Next.

15. From the Database list under Tables and Views, only check Bookings and
Calendar.

16. Select the Bookings table row and click the Preview & Filter button to view the
data. After view the data, click OK.

17. Click Finish. If the security warning dialog box is displayed, click OK. Note the
success of the imported data.

18. Click Close. Note the 2 additional tabs for Bookings and Calendar tables on the
bottom left.

© 2022 Online Consulting, Inc., Revised 01/07/22 88


ONLC Training Centers Excel BI Tools Labs and Reviews

19. On the Quick Access Toolbar, click Save.

20. On the Ribbon select the Power Pivot tab and select Manage.

21. In the Bookings table, format the date fields to the short date style. Format the
Amount field to currency.

22. In the Bookings table note the ID and Destination# in the first row of data. It
should be ID 11 and Destination# 35.

23. Open Access. Open the LeapsAndBounds file.

24. Open the Bookings table and move to record for ID 11. Change the Destination#
to 111 then move to the next record to save your changes. Close Access.

25. Return to the Destinations.xlsx file in the Data Model. Note the record is not
changed.

26. On the Home tab in the Data Model, click Refresh. In the Data Refresh dialog
box, note success and click Close. Note the change to the Destination# 111 in the
first row for ID 11.

27. Return to Excel.

28. In Excel, change the Destination_City in the first row from Marrakech to
Casablanca. Save the file.

29. Return to the Data Model.

30. On the bottom left switch to Destinations table. If the Destination_City has not
changed, click the Maarakech cell. On the Ribbon, select the Linked Tables tab.
In the Linked Tables group, click Update Selected.

31. On the Home tab in the View group in the Data Model, click Diagram View.

32. Resize any table as needed to see all the fields.

33. Move the Bookings table to the second row in the middle. In the top row arrange
the tables by Destinations, AgentInfo and Calendar.

34. In the Destinations table, drag the Destination# field to the Bookings table
Destination#. Once you release the mouse button, a join line is established
between the two tables.

35. In the AgentInfo table, drag the Agent# to the Bookings table Agent#.

36. For now, there will not be a relationship with the Calendar table.

37. Switch to Data View.

38. On the Ribbon, select PivotTable then PivotTable. Create a new PivotTable.
From the Destination table select the Destination_Country for the Rows area.
From the AgentInfo table select the Agent_Name for the Columns area. From the
Booking table select the Amount for the Values area.

© 2022 Online Consulting, Inc., Revised 01/07/22 89


ONLC Training Centers Excel BI Tools Labs and Reviews

39. Name the worksheet AmountbyCountry.

40. Save the file.

41. Return to the Data Model. In the Bookings table, format the Amount column to
Currency.

42. Return to Excel and note the change to the Amount column in the PivotTable.

43. Return to the Data Model in Diagram View.

44. In the Destinations table, right click on Destination_Region and select Create
Hierarchy. Name the hierarchy Geographic Hierarchy with the three fields
Destination_Region, Destination_Country, and Destination_City.

45. Return to Excel. In the AmountbyCountry worksheet, remove the


Destination_Country field from the Row area. Add the Geographic Hierarchy.

46. Select Africa in cell B5. Use the Quick Explore smart tag to drill down and up
the hierarchy. Save the file.

47. Return to the Data Model in Data View.

48. In the Bookings table, add a calculated column to determine the commission per
trip. The Commission column will be 10% of the Amount field.

49. In the Bookings table, add another calculated column to determine the profit.
The NetProfit field will take the Amount minus the Commission.

50. Make sure the Amount, Commission and NetProfit columns are formatted as
Currency.

51. Create a new PivotTable showing the Amount, Commission, and NetProfit by
Agent_Name. Name the worksheet AgentCommission.

52. Save the file.

53. Return to the Data Model.

54. In the Bookings table in the calculation area, create a measure that totals the
Amount column. Change the name of the measure to TotalAmount. Make sure
the measure is formatted as currency.

55. In the Bookings table, create a measure that totals the Length of Stay column.
Change the name of the measure to TotalLength.

56. Create a new PivotTable on a new worksheet. For now, only add the
Destination_City to the PivotTable.

57. Name the worksheet CityTotals.

58. On the Ribbon, select the Power Pivot tab. Select Measures and choose New
Measure.

© 2022 Online Consulting, Inc., Revised 01/07/22 90


ONLC Training Centers Excel BI Tools Labs and Reviews

59. From the Bookings table, create a measure named DailyAverageTotal that takes
the TotalAmount divided by the TotalLenght. Format the measure as Currency.

60. In Excel, return to the CityTotals worksheet.

61. In the PivotTable have the Destination_City in the Rows area. Add
TotalAmount, TotalLength, and DailyAverageTotal, to the Values area.

62. Save the file.

63. In Excel, select the Power Pivot tab. Create a new KPI for the
DailyAverageTotal measure. Use an absolute of 550. The thresholds are below
500, 500 to 550, above 550.

64. In the CityTotals PivotTable, add the DailyAverageTotal KPI Value and Status to
the PivotTable. If the KPI circles do not show up, clear the check for Status and
add it back again.

65. In the CityTotals PivotTable, add conditional formatting to the TotalAmount


column for any TotalAmount over $750,000.

66. Save and close the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 91


ONLC Training Centers Excel BI Tools Labs and Reviews

Excel BI Tools Review 2 Lab


1. Open Windows Explorer and Navigate to the student data folder.
Try It 2. Double-click AdventureWorks.accdb. Click Enable Content in the Yellow
Security Warning bar. View the tables. Close the file.

3. Start Excel and open a blank workbook.

4. Save the file to the student data folder and name the file AdventureWorksModel.

5. In Excel, on the Ribbon select the Power Pivot tab. Click Manage.

6. To import Access tables, on the Ribbon on the Data Model Home tab, select
From Database. Choose From Access.

7. In the Table Import Wizard, click Browse. Select the AdventureWorks.accdb file
from the student data folder and click Open. Click Next.

8. Make sure Select from a list of tables and views to choose the data to import is
checked and click Next.

9. From the Database list under Tables and Views, only check Customer, Product,
Sales, and Territories.

10. Select the Product table row and click the Preview & Filter button to view the
data. Click OK.

11. Click Finish. If the security warning dialog box is displayed, click OK. Note the
success of the imported data.

12. Click Close. Note the four tabs for Customer, Product, Sales, and Territories
tables on the bottom left.

13. Rename the Sales table to FactSales.

14. Rename Customer to DimCustomer, Product to DimProduct and Territories to


DimTerritories.

15. On the Quick Access Toolbar, click Save.

16. On the Ribbon, select the Power Pivot tab and click Manage to return to the Data
Model.

17. In the DimCustomer table, select the drop-down list for CustomerKey. Select
Sort Smallest to Largest.

18. Locate the CustomerKey 11008 in the first column of data. The FirstName for
11008 should be Robert not Rob.

19. Open Access. Open the AdventureWorks.aacdb file from the student data folder.

20. Open the Customer table and move to the CustomerKey 11008 record. Change
the FirstName to Robert. Change the FullName to Verhoff, Robert then move to
the next record to save your changes. Close Access.

© 2022 Online Consulting, Inc., Revised 01/07/22 92


ONLC Training Centers Excel BI Tools Labs and Reviews

21. Return to the Data Model. Note in the DimCustomer table the record is not
changed.

22. On the Data Model Home tab, click Refresh. In the Data Refresh dialog box,
note success and click Close. Note the change to the FirstName and FullName
for CustomerKey 11008. Make the columns wider, if necessary.

23. Click Save. Return to the Data Model.

24. On the Data Model Home tab in the View group, click Diagram View.

25. To create relationships between the tables, resize any table as needed to display
all the fields. Move the FactSales table to the second row in the middle. In the
top row arrange the tables by DimCustomer, DimProduct, and DimTerritories.

26. In the DimCustomer table, drag the CustomerKey field to the FactSales table
CustomerKey field. Once you release the mouse button, a join line is established
between the two tables. Click the join line and make sure the two tables are
linked by the CustomerKey field.

27. In the DimProducts table, drag the ProductKey to the FactSales table
ProductKey.

28. In the DimTerritories table, drag the SalesTerritoryKey to the FactSales table
SalesTerritoryKey.

29. Switch to Data View.

30. On the Data Model Home tab, select PivotTable then PivotTable. Click OK for a
new worksheet.

31. In the PivotTable, select the DimTerritories Region field for the Rows area.
From the FactSales table, select the SalesAmount for the Values area.

32. Name the worksheet AmountbyTerritory.

33. Save the file. Return to the Data Model.

34. Switch to Diagram View to create a Hierarchy. Extend the length of the
DimCustomer table about an inch.

35. In the DimCustomer table, right-click the CustomerCountry field and select
Create Hierarchy. Create a Hierarchy named Geographic Hierarchy with
CustomerCountry, then the CustomerState and then the CustomerCity.

36. Return to Data View.

37. Create a new PivotTable on a new worksheet.

38. In the DimCustomer table, add the Geographic Hierarchy to the Row area. Add
the FactSales OrderQuantity to the Values area.

39. In the PivotTable, click in the United States cell. Use the Quick Explore smart
tag to drill down and up the hierarchy.

© 2022 Online Consulting, Inc., Revised 01/07/22 93


ONLC Training Centers Excel BI Tools Labs and Reviews

40. Save the worksheet as GeographicQuantity.

41. Save the file.

42. Return to the Data Model in Data View.

43. In the FactSales table, add a calculated column to determine the commission. To
the right of the current columns, double-click Add Column. Name the column
Commission and press Enter. The Commission column formula will be the
SalesAmount field times 10%. The formula should look like =[SalesAmount]*.1
and press Enter.

44. In the FactSales table, add another calculated column to determine the profit.
The NetProfit field will take the SalesAmount minus the TaxAmt minus the
Commission. The formula should look like =[SalesAmount]-[TaxAmt]-
[Commission] and press Enter.

45. Create a new PivotTable showing the SalesAmount, TaxAmt, Commission, and
NetProfit from FactSales. Add from the DimProduct table the ProductName for
Rows.

46. Name the worksheet ProductTotals.

47. Save the file.

48. Return to the Data Model.

49. In FactSales in the calculation area on the bottom under the TotalProductCost
field, click the first cell. On the Home tab, select AutoSum to create a measure.
Change the named SumTotalProductCost. The formula should look like
SumTotalProductCost:=SUM([TotalProductCost]).

50. In FactSales, create another measure under the SalesAmount column named
SumSalesAmount that sums the SalesAmount column. The formula should look
like SumSalesAmount:=SUM([SalesAmount]).

51. Create a new PivotTable on a new worksheet.

52. On the Ribbon, select the Power Pivot tab. Select Measures and click New
Measure.

53. In the Measure dialog box, for the Table name, select FactSales. Name the
measure ProductProfit. The formula will take the FactSales table
SumSalesAmount minus the FactSales table SumTotalProductCost. The formula
should look like =[SumSalesAmount]-[SumTotalProductCost] then format the
field as Currency. Click OK. If you get an error message, click OK.

54. On the PivotTable, select the DimCustomer CustomerCountry for the Rows.
Select the DimProduct Category for the Columns. In FactSales, select the
ProductProfit as the Values.

55. Name the worksheet CategorybyCountryProductProfit.

56. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 94


ONLC Training Centers Excel BI Tools Labs and Reviews

57. Return to the Data Model. Create a new PivotTable on a new worksheet.

58. In the PivotTable, select the CustomerCountry for the Rows area.

59. On the Power Pivot tab, create a new KPI for the ProductProfit. Use an absolute
value of 3,000,000. The thresholds are below 1,000,000, 1,000,000 to 2,000,000
and above 2,000,000. Click OK.

60. From FactSales, add the KPI for the ProductProfit displaying the Value and
Status.

61. Name the worksheet CountryProfitKPI.

62. Save and close the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 95


ONLC Training Centers Excel BI Tools Labs and Reviews

Excel BI Tools Review 3 Lab


1. Open the AdventureWorksModelReview3 Excel file.
Try It 2. On the Ribbon on the Power Pivot tab, select Manage to open the Data Model.

3. In the FactSales table, create a new measure in the calculated field area under the
ProductKey. Named the measure Sales that is the sum of the FactSales table
SalesAmount field. The formula should be
Sales:=SUM(FactSales[SalesAmount]) and format it as Currency.

4. Create another measure named Cost that is the sum of FactSales


TotalProductCost formatted as Currency.

5. Create another measure named Margin that takes the FactSales[Sales] minus the
FactSales[Cost] formatted as Currency.

6. To create the margin percent, create a measure named MarginPercent. Use the
Divide function to divide the Margin by the Sales. The formula should be
MarginPercent:=DIVIDE(FactSales[Margin],FactSales[Sales]) and format it as
Percentage.

7. Create a new PivotTable on a new worksheet. In the DimProducts table, select


ProductName for the Rows. In the FactSales table, select Sales, Cost, Margin
and MarginPercent for the Values.

8. Save the worksheet as PercentMargin.

9. Save the file.

10. Return to the Data Model.

11. Create a PivotTable on a new worksheet.

12. On the Ribbon on the PowerPivot tab, select Measures then select New Measure.

13. In the dialog box, select the FactSales table for the Table name. Name the
measure SalesOrderCount. In the formula box, use the function
DISTINCTCOUNT for the FactSales[SalesOrderNumber] field. Format the field
as number, whole number and use 1000 separator. Click OK. If you get an error
message, click OK.

14. Create another measure named AverageSpendingPerOrder for the FactSales


table. Use the Divide function to take the FactSales[Sales] divided by the
FactSales[SalesOrderCount]. Format this field as Currency with 2 decimal
places and use 1000 separator. Click OK.

15. On the PivotTable, from the FactSales table, the SalesOrderCount and the
AverageSpendingPerOrder fields should already be added for the Values area.

16. From the DimCustomer table, add the LastName to the Rows area.

17. Name the worksheet AverageSpendingPerOrder.

18. Save the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 96


ONLC Training Centers Excel BI Tools Labs and Reviews

19. Return to the Data Model.

20. Create a new PivotTable on a new worksheet.

21. On the Ribbon on the Power Pivot tab, select Measures then select New Measure.

22. For the FactSales table, created a measure named FemaleSales. Use the Calculate
function to find the totals Sales for the Gender equal to Females. The formula
will look like =CALCULATE(FactSales[Sales],DimCustomer[Gender]=”F”).
Format the field as Currency.

23. Create another measure named MaleSales to find the Sales for the Gender equal
to Males. Format the field as Currency.

24. On the PivotTable, the FactSales table, FemaleSales and MaleSales should
already be added to the Values area. From the DimProducts table, select the
SubCategory field for the Rows area.

25. Name the worksheet FemaleMaleSales.

26. Save the file.

27. Create a new workbook in Excel.

28. In cell A1, type DateKey as the column heading.

29. In cell A2, type 1/1/12.

30. On the Home tab select Fill then choose Series. In the dialog box select Series in
Columns, Step Value 1, Stop Value 12/31/14 and click OK. (Or use the Auto Fill
handle to copy the date until you reach 12/31/14).

31. Name the worksheet Calendar.

32. Save the file in the data folder as AdventureWorksCalendar. Close the file.

33. Return to the AdventureWorks Data Model.

34. On the Home tab in the Get External Data group, select From Other Sources. In
the drop-down list, select Excel File and click Next.

35. Click Browse and find the file named AdventureWorksCalendar in the Data
Folder and click Open.

36. Select Use first row as column headers. Click Next.

37. Click the Preview & Filter icon to check the data. Click OK.

38. Click Finish. Click Close.

39. To relate the Calendar to the Data Model, click Diagram View.

40. In table FactSales, select the OrderDate field and drag it to the Calendar DateKey
field.

41. Return to Data View.

© 2022 Online Consulting, Inc., Revised 01/07/22 97


ONLC Training Centers Excel BI Tools Labs and Reviews

42. Select the Calendar table if necessary. In the Data Model on the Design tab,
select Mark as Date Table then select Mark as Date Table. Click OK to have
DateKey as the unique identifier.

43. To add the Month column, double-click Add Column and name it Month and
press Enter.

44. Create the calculation =Month(‘Calendar’[DateKey]) and press Enter.

45. Create another column next to it named MonthName.

46. The formula will be =Format(‘Calendar’[DateKey],”mmmm”).

47. To find the Total Price per Month, on the Data Model Home tab, click
PivotTable then select PivotTable. Click OK for a new worksheet.

48. Select the MonthName from the Calendar table and add it to the ROWS area.

49. Select the Sales from the FactSales table. Note the months are in alphabetical
order.

50. Name the worksheet tab SalesbyMonth.

51. Save the file.

52. Return to the Data Model.

53. In the Calendar table, select the MonthName field. On the Home tab in the
Ribbon, in the Sort & Filter group, click Sort by Column then select Sort by
Column. In the dialog box, select MonthName for the Sort column and Month
for the By column and click OK.

54. Return to Excel and notice the order of the months in the SalesbyMonth
worksheet.

55. Save the file.

56. Return to the Data Model.

57. Add a new column named Year.

58. Create the calculation =Year(‘Calendar’[DateKey]) and press Enter.

59. Create a new PivotTable on a new worksheet that shows the NetProfit by Year.
Name the worksheet NetProfitbyYear.

60. Save the file.

61. Return to the Data Model.

62. Create a PivotTable report with a Chart and Table (Vertical) on a new worksheet.

63. Name the worksheet YearlySalesReport.

64. In the Chart, from DimProduct table, select the SubCateory field for the Axis
(categories) area. In the FactSales table, select Sales for the Values.

© 2022 Online Consulting, Inc., Revised 01/07/22 98


ONLC Training Centers Excel BI Tools Labs and Reviews

65. In the PivotTable, select the same fields.

66. While in the PivotTable, on the PivotTable Tools Analyze tab, select Insert
Slicer. In the Insert Slicers dialog box, click the All tab. Add slicers for Year
and SubCategory fields.

67. On the worksheet, arrange the slicers as desired.

68. If the slicers do not control both the PivotChart and the PivotTable, select the
SubCategory slicer. On the Slicer Tools Options tab, select Report Connections.
Make sure the YearlySalesReport PivotChart and PivotTable are both checked
and click OK.

69. Select the Year slicer. In the Report Connections dialog box, make sure the
YearlySalesReport PivotChart and PivotTable are both checked and click OK.

70. Format the PivotChart and PivotTable as desired.

71. Save and close the file.

© 2022 Online Consulting, Inc., Revised 01/07/22 99

You might also like