Professional Documents
Culture Documents
Hands-on-Lab
Terms of Use
© 2010 Microsoft Corporation. All rights reserved.
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the companies, organizations, products, domain
names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no
association with any real company, organization, product, domain name, e-mail address, logo,
person, place, or event is intended or should be inferred. Complying with all applicable copyright
laws is the responsibility of the user. Without limiting the rights under copyright, no part of this
document may be reproduced, stored in or introduced into a retrieval system, or transmitted in
any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for
any purpose, without the express written permission of Microsoft Corporation.
For more information, see Microsoft Copyright Permissions at
http://www.microsoft.com/permission
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
The Microsoft company name and Microsoft products mentioned herein may be either registered
trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
This document reflects current views and assumptions as of the date of development and is
subject to change. Actual and future results and trends may differ materially from any
forward-looking statements. Microsoft assumes no responsibility for errors or omissions in
the materials.
THIS DOCUMENT IS FOR INFORMATIONAL AND TRAINING PURPOSES ONLY AND IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
Lab Environment
During this lab, you will work in a simulated environment with the following computers
or virtual machines.
Logon Credentials
The lab environment might require you to logon to the Hands-on-Lab Environment using
the following credentials, unless specified differently throughout the lab manual.
Username Password
LabUser pass@word1
Lab Overview
Abstract
During this lab, you will walk through several exercises that will help you achieve a better
understanding of the capabilities of Microsoft PowerPivot. PowerPivot, to quote the SQL
Server 2008 R2 RC documentation, “refers to a collection of applications and services that
provide an end-to-end approach for creating data-driven, user-managed business
intelligence solutions in Excel workbooks.” PowerPivot integrates with Microsoft Excel
2010 and SharePoint 2010. The PowerPivot Add-in for Excel is a tool that extends the
data analysis capabilities of Excel 2010.
Learning Objectives
After completing the exercises in this lab, you will be able to:
Import SQL Server data into PowerPivot
Create a sales report using PowerPivot data
Import data from a web site into PowerPivot
Start PowerPivot 1. Click Start | All Programs | Microsoft Office | Microsoft Excel 2010.
1. Click the PowerPivot tab.
2. Click the PowerPivot Window button to start the PowerPivot add-in. The
add-in loads a new top-level window entitled PowerPivot for Excel.
Connect PowerPivot 1. In the PowerPivot for Excel window, click the From Database button,
to an external data followed by the From SQL Server menu, to start the data loading process.
source and control PowerPivot starts the Table Import Wizard.
what data it imports
6. From the list of available tables, scroll down and place a check next to the
FactSales table.
7. Click the Select Related Tables button to have the wizard select those
tables related to FactSales. The wizard displays a message that “the related
tables 6 were selected”.
11. Scroll to the right until you can see the CurrencyKey column.
12. Remove the check from the CurrencyKey column.
13.Click OK to apply the filter and return to the wizard. Notice that the Filter
Details column now shows Applied filters.
14. Click on the table name FactSales in the Friendly Name column and change
the name to Sales.
Notice how PowerPivot has transferred almost 3.5 million rows from the
Sales table. With more memory, you could work with 100 million row
datasets.
16. Once the import process is complete, click the Details button in the
Message column to review any status messages. Generally, you only need to do
this if any errors occurred.
Create a calculated 1. At the bottom of the window, you will see a tab for each imported table.
column Right click on the DimChannel tab and choose Rename from the context menu.
19. Change the name to Channel. You can rename the tables to make it easier
for you to work with them.
20. Click on the Sales tab.
21. Scroll all the way to the right until you can see the Add Column column.
24.With the new CalculatedColumn1 column selected, right click and select
Rename Column from the context menu.
25. Type Profit to change the column name and press Enter.
26.Click the PowerPivot button in the upper left corner of the application
window and select Save.
28. Once PowerPivot has saved the file, continue to the next exercise.
Create a PivotTable Exercise 2 assumes you have completed Exercise 1 and that Excel 2010
and PivotChart and the PowerPivot for Excel window are still open.
connected to
PowerPivot for Excel 1. If necessary, click the ContosoSales.xlsx button on the Task Bar to activate
the PowerPivot for Excel window.
2. Select the PivotTable button and from the drop-down menu, choose the
Chart and Table (Vertical) menu option. PowerPivot will return you to Excel
window.
3. In the PowerPivot Field List, scroll to the bottom of the list of tables until
you find the Sales table. Then find the Profit field that you created with the
DAX formula and place a check next to it.
4. Next, find the ClassName field in the DimProduct table. Drag and drop it
into the Row Labels box.
5. Now find the ChannelName field in the Channel table. Drag and drop it into
the Row Labels box.
6. Place a check next to the TotalCost field in the Sales table. You’ll note that
Excel adds it under the existing Profit field in the Values box and to the left of
the Sum of Profit column in the PivotTable.
7. Click the drop-down menu on the Sum of Profit field in the Values box and
select Move Down.
14. Highlight all of the cells in the PivotTable that contain numeric figures.
15. Click the Home tab on the Ribbon followed by the $ symbol to format the
selected values.
16.Next, click the Format button and from the drop-down menu, choose the
AutoFit Column Width command.
you find the Sales table. Find the Profit field and place a check next to it.
19. Find the ClassName field in the DimProduct table. Drag and drop it into the
Axis Fields box.
20. Next, find the ChannelName field in the Channel table. Drag and drop it
into the Axis Fields box.
21. On the PivotChart, select the Y Axis label, then right click and select Format
Axis.
22. In the Format Axis dialog, change the Display units to Thousands.
26. Select the chart title Total and change it to Total Profit.
27. Resize the chart so that it is as wide as the PivotTable below it. Click the
right side of the charge on the grab handle. The cursor will change to a double-
headed arrow. Drag to left until it is the correct width.
28. Right click on the white, open area of the chart, and select Format Chart
Area.
29. If it’s not already selected, select the Fill tab.
30. Select the Picture or texture fill option.
31. From the Texture drop down, select White Marble (second row, fifth
column) and click OK.
You’ve now formatted your chart. You can also use other pictures from
your hard drive if you have them.
32. However, you can also use Excel’s built-in themes. Select the pivot chart.
33. Then Click the Design tab of the PivotChart Tools section on the Ribbon.
34. Next, click the drop down button to expand the Chart Styles gallery.
35. From the gallery, pick the bottom option in the current column.
36. Next, place your cursor in the Pivot Chart, cell A16 for example.
37. Click the Design tab on the PivotTable Tools group of the Ribbon.
38. Now click the drop down to expand the style gallery.
39. Scroll down the gallery and pick Pivot Style Dark 16 (2nd column from the
left, 2nd row up from the bottom).
You’ve now formatted your table to professionally match your chart (see
next page).
You can easily reset or change back your settings via Undo or by picking
the early values from the appropriate style gallery (which is what I’ve
done for the rest of this exercise).
Configure Data Slicers 1. In the PowerPivot Field List task pane, locate the RegionCountryName
for the PivotTable and field under the DimGeography table. Drag and drop it to the Slicers Horizontal
PivotChart box.
2. Find the PromotionName field in the DimPromotion table. Drag and drop it
to the Slicers Vertical box.
3. Finally, locate the Manufacturer field in the DimProduct table. Drag and
drop it to the Slicers Vertical box below the PromotionName field already
there..
4. Right click on the Horizontal Slicer labelled RegionCountryName, and
select Slicer Settings.
5. Change the Caption from RegionCounrtyName to Country and click OK.
6. Repeat the process and change the title of the first Vertical Slicer from
PromotionName to Promotion.
7. In the Country slicer, select only Ireland. Notice how the PivotChart and
PivotTable update in real time. Play around with other slicers to get a feel for
how the real time analysis works. And note that if you wish you can style the
slicers just as you did the chart and table.
9. Close Excel by clicking the Excel drop-down menu and select Exit.
10. If prompted to save your changes, do so. Excel will close the PowerPivot for
Excel window.
In this task, you’ll 1. Start Internet Explorer by clicking Start | All Programs | Internet Explorer.
gather data from the
web so you can work
2. Navigate to http://miami:987/. You are going to see data downloaded
with it in PowerPivot. from http://www.eia.doe.gov/cneaf/electricity/esr/table5.html.
3. You can click one of the three tabs (Residential, Commercial, and Industrial)
to see the different data.
4. On the Home tab, on the PowerPivot Ribbon, click the Paste button in the
Clipboard group.
5. In the Paste Preview dialog, remove the check next to the Use first row as
column headers (if checked) and click OK.
11. In the Paste Preview dialog, review the data and then click OK to load the
data.
4. Select the Average Monthly Bill Dollar and cents column. Right click and
select Rename Column from the context menu.
5. Change the column name to Average Monthly Expense.
6. Rename the Average Retail Price Cents per Kilowatthour column to
Average Retail Price kWh.
12. Switch back to Internet Explorer.
7. Using your mouse, select the entire table starting from the table headers
but excluding the last row containing the US Totals..
13. Right click and select Copy from the context menu.
14. Switch back to the PowerPivot for Excel window.
8. Select Paste Replace from the Ribbon.
9. In the Paste Preview dialog, accept the defaults and click OK. Notice how
your column names and formatting remains.
10. Switch to Excel.
11.Close Excel by clicking the Excel drop-down menu and select Exit (see next
page).
11.If prompted to save your changes, select Don’t Save. Excel will close the
PowerPivot for Excel window.
12. Close Internet Explorer.
Save your data to 1. Click Start | All Programs | Microsoft Office | Microsoft Excel 2010.
SharePoint 2010
PowerPivot Gallery.
2. Select File and then open the previously saved ContosoSales.xlsx file you
created in the earlier exercises. After a few moments, the security warning
should go away and PowerPivot will have refreshed your data. If still visible,
click the Enable Content button on the Security Warning message.
3. Select File | Save As.
4. In the File name field of the Save As dialog, type http://miami and press
Enter. You’ll be at the root of the local SharePoint 2010 site.
there are any existing items, the dialog will display them. After you double-click,
give the dialog a few seconds to refresh.
6. Change the File name to Contoso Sales and click Save.
7. As Excel saves, it transfers your file to the Microsoft Office Upload Center,
which handles uploading your file in the background.
8. You can click on the Upload Center icon and open the Upload Center (not
necessary) to see what files are uploading and their progress. Depending on the
speed of your machine this will take a few short seconds to a minute or so.
9. Once your save is complete, start Internet Explorer by clicking Start | All
Programs | Internet Explorer.
6. Navigate to http://miami.
7. On the home page, click the PowerPivot Gallery link.
Once the page loads, you’ll see a nicely rendered gallery that uses
Silverlight to provide a rich visual experience.
13.If you move your mouse over the three thumbnails to the right of the larger
image, you’ll get previews of the various sheets in your workbook.
14. Click the Library tab, and you can change the view for even richer displays.
15. Under the Current View, expand the drop down and select Theater.
16. Now change the view to Carousel. You get another rich presentation.
17. Change the view back to Gallery, the default.
If you click the second thumbnail, SharePoint will open the sheet for you in the
browser. This allows for interactive data analysis right from your browser.
18. Click Italy in the Country slicer. Notice the data chart updates.
By default, the data shown with the workbook is what you saved when
you uploaded the workbook to SharePoint. You however, have full
control over the data refresh schedule and can have your workbook
refreshed automatically behind the scenes.
20. In the Gallery, click the Manage data refresh icon in the upper right-hand
corner of the Contoso Sales report.
As you can see on the Manage Data Refresh: Contoso Sales page, you
first need to check the Enable box. Once you do, you can define the
schedule as well as an Also refresh as soon as possible option.
27. Scroll down the page and select the PowerPivot | Management Dashboard
link.
28. Scroll the page and you’ll see a summary of your recent Data Refresh
activity as well as any Data Refresh failures.
29. Close the browser and return to you other instance of Internet Explorer.
30. In the Gallery, click the Manage data refresh icon in the upper right-hand
corner of the Contoso Sales report.
Notice now because you’ve run a report, you get a user visible summary
page of the refreshes that have occurred.
31. Click the Configure Schedule link.
32. Remove the check from Enable to turn off data refresh.
33. Click OK.
37. Scroll down the page and select the PowerPivot | Management Dashboard
link.
There are seven web parts on the page providing you with information
about the health of your system as well as what data is important to your
users.
The Infrastructure – Server Health web part displays CPU and memory
usage for the PowerPivot service. You can click the view drop-down to get
various metrics including query response time, how many queries have
been exectued (activity), memory usage, etc.
38.Load each option from the View drop down for the Infrastructure – Server
Health. Note depending upon the environment you’re using you may not have
much or any data for some items.
Next to the Workbook Activity – Chart, you’ll find the Workbook Activity
– List web part. This provides a list view that shows the frequency of data
access in a list format.
Earlier you used the dashboard to see Data Refresh activity web parts.
The two web parts here show you Recent Activity and Recent Failures
(which should be empty).
Finally, the Reports web part provides links to other reports and a data
connection file that links to PowerPivot management data. This allows
you to extend the dashboard with own custom Usage reports. The two
default workbook reports let you drill down into the Server Health data
and Workbook Usage data already displayed on the dashboard so you can
do deeper analysis.
40. Close Internet Explorer.
Work with Data 1. Click Start | All Programs | Microsoft Office | Microsoft Excel 2010. If it’s
Analysis Expressions already running, close it and restart Excel 2010.
(DAX)
10. Select File and then open the previously saved ContosoSales.xlsx file you
created in the earlier exercises. After a few moments, the security warning
should go away and PowerPivot will have refreshed your data. If still visible,
click the Enable Content button on the Security Warning message.
41. Click the PowerPivot tab.
42. Click the PowerPivot Window button to start the PowerPivot add-in.
Earlier you created a calculated column that you named Profit. This is a
simple example of what you can do with DAX. You can also combine
12. Scroll to the right until you can see the Add Column header.
13.Add the following DAX formula to the formula bar and press Enter when
done:
=[StoreName] & "--" & [StorePhone]
You now have a combined column showing the name and phone number
in one field.
14.Change the column name from Calculated Column2 to Store Contact
Number by right clicking on the column header and selecting Rename Column.
15. Add a new column by adding the following DAX formula to the formula bar
and press Enter when done:
=RELATED(DimGeography[RegionCountryName])
This does a lookup from the DimGeography table and displays the value
for each item.
16. Rename the newly added column to Store Country.
17. Switch to the Channel table by clicking its tab at the bottom.
18. Add a new column by adding the following DAX formula to the formula bar
and press Enter when done:
=COUNTROWS(Sales)
This doesn’t look right. COUNTROWS gives you the total rows for the
table.
19. Instead, change the DAX formula in the formula bar to:
=COUNTROWS(RELATEDTABLE(Sales))
Now you’re getting the count of each row via the relationship and thus a
filtered subset of the number of rows.
23. Switch to the DimProduct table by clicking its tab at the bottom.
24. Add a new column by adding the following DAX formula to the formula bar
and press Enter when done:
=SUMX(RELATEDTABLE(Sales), Sales[SalesAmount])
25. Switch to the DimStore table by clicking its tab at the bottom.
26. Now do add a new column using the same formula (you can copy and paste
your earlier entry):
=SUMX(RELATEDTABLE(Sales), Sales[SalesAmount])
You’ve now used the same formula to see sales data aggregated across
multiple tables.
29. Switch to the DimProduct table by clicking its tab at the bottom.
30. Add a new column by adding the following DAX formula to the formula bar
and press Enter when done:
=CALCULATE(SUM(Sales[SalesAmount]),
Channel[ChannelName]="Store")
Here you see the Sales Amount for each product by row but only for
those items sold at retail stores.
41. Close the PowerPivot window.
42. Close Excel. You don’t need to save changes.
Appendix
Labcode Manual Version Last Update
Version 154 4/2/2010 9:23:00 AM
Lab Notes
Description Details