You are on page 1of 19

Power Pivot

Power Pivot

Table of Contents
Power Pivot........................................................................................................................... 1
Exercise 1 Getting Started .............................................................................................................................................2 Exercise 2 Work with Data .............................................................................................................................................9 Exercise 3 Load Data from the Web ............................................................................................................................14

Power Pivot

Power Pivot
Objectives
After completing this lab, you will be better able to: Import SQL Server data into PowerPivot Create a sales report using PowerPivot data Import data from a web site into PowerPivot

Scenario

During this lab, you will run several exercises that will help you achieve a better understanding of the capabilities of product Microsoft SQL Server 2008 R2 PowerPivot. PowerPivot is a new version of SQL Server Analysis Services that integrates with Microsoft Excel 2010 and SharePoint 2010. The PowerPivot Addin for Excel is a tool that extends the data analysis capabilities of Excel. 45 Minutes

Estimated Time to Complete This Lab Computers used in this Lab

MIAMI

The password for the Administrator account on all computers in this lab is: pass@word1.

Page 1 of 17

Power Pivot

Exercise 1 Getting Started


Scenario
In this exercise, you will learn how to import and prepare data from a SQL Server 2008 R2 database into the Microsoft Project PowerPivot Add-in for Microsoft Office Excel 2010 (PowerPivot). By the end of this exercise, you will understand: How to launch PowerPivot How to connect a PowerPivot to an external data source to the PowerPivot How to control what data is imported into PowerPivot Create a calculated column using a Data Analysis Expression formula

Tasks Complete the following task on: MIAMI 1. Start PowerPivot

Detailed Steps a. Click Start, All Programs, Microsoft Office, Microsoft Excel 2010 b. Click the PowerPivot tab. c. Click the PowerPivot window button to start the PowerPivot add-in. The add-in loads a new top-level window entitled PowerPivot Client Window.

2.

Connect PowerPivot to an external data source and control what data it imports

a. In the PowerPivot Client Window, click the From Database button, and select From SQL Server from the list of data sources. b. In the Server name field, enter localhost. c. In the Database name combo-box, select ContosoRetailDW from the list. The wizard automatically creates a Friendly connection name. d. Click the Next button to continue the running the wizard. e. On the Choose How to Import the Data page, choose the Select from a list of tables and views to choose the data to import option and click Next.

Page 2 of 17

Power Pivot Tasks Detailed Steps

f. From the list of available tables, scroll down and place a check next to the FactSales table. g. Click the Select Related Tables button to have the wizard select those tables related to FactSales. The wizard displays a message that 6 related tables were selected. h. With the FactSales table still selected, click the Preview and Filter button. The wizard opens a new window where you can filter the data that it imports.

i. Remove the check for the SalesKey column.

Page 3 of 17

Power Pivot Tasks Detailed Steps

j. Scroll to the right until you can see the CurrencyKey column. Remove the check from the CurrencyKey column.

k. Click OK to apply the filter and return to the wizard. Notice that the Filter Details column now shows Applied filters. l. Click on the table name FactSales in the Friendly Name column and change the name to Sales. m. Click Finish to start the import and prepare process.

Page 4 of 17

Power Pivot Tasks Detailed Steps

Note: As the import process progresses, the dialog provides you with information about the number of rows transferred.

Page 5 of 17

Power Pivot Tasks Detailed Steps

Note: Notice how PowerPivot has transferred almost four million rows from the Sales table. With more memory, you could work with 100 million row datasets.

n. 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.

Page 6 of 17

Power Pivot Tasks Detailed Steps

o. Click OK, then Click Close to close the wizard and return the PowerPivot Client Window. 3. Create a calculated column a. At the bottom of the window, you will see a tab for each imported table. Right click on the DimChannel tab and choose Rename from the context menu.

b. Change the name to Channel. You can rename the tables to make it easier for you to work with them. c. Click on the Sales tab. d. Scroll all the way to the right until you can see the Add Column column.

e. Select Add Column. Note: If you dont see the Add Column or Formula Bar, please close the PowerPivot Window then re-open it by clicking the PowerPivot Window button. f. In the formula bar enter =[SalesAmount] - [TotalCost] and press Enter. PowerPivot creates the new column and updates the screen with your calculation.

Page 7 of 17

Power Pivot Tasks Detailed Steps

g. With the new CalculatedColumn1 column selected, right click and select Rename Column from the context menu.

h. Type Profit to change the column name and press Enter. i. Click the File button beneath the PowerPivot button in the upper left corner of the application window and select Save.

j. Change the path to the desktop and name the file ContosoSales.xlsx and click Save. k. Once PowerPivot has saved the file, continue to the next exercise.

Page 8 of 17

Power Pivot

Exercise 2 Work with Data


Scenario
In this exercise, you create a sales report in Excel 2010 using PowerPivot as your in-memory data source containing almost four million rows.

By the end of this exercise, you will understand: How to create a PivotTable and PivotChart report connected to PowerPivot Use data slicers to filter data Tasks Complete the following task on: MIAMI 1. Create a PivotTable and PivotChart connected to PowerPivot Detailed Steps Note: Exercise 2 assumes you have completed Exercise 1 and that Excel 2010 and the PowerPivot Client Window are still open. a. If necessary, click the ContosoSales.xlsx button on the Task Bar to activate the PowerPivot Client Window. b. 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.

c. In the Insert PivotTable dialog, choose the Existing Worksheet option and click OK.

Page 9 of 17

Power Pivot Tasks Detailed Steps

d. In the Gemini Task Pane, scroll to the bottom of the list of tables until you find the Sales table. Then find the Profit field and place a check next to it. e. Next, find the ClassName field in the DimProduct table. Drag and drop it into the Axis Fields box.

f. Now find the ChannelName field in the Channel table. Drag and drop it into the Row Labels box. If you do not see the Row Labels box, try clicking the chart and then clicking the Sum of Profit field below the chart. You may need to do this several times. g. Place a check next to the TotalCost field in the Sales table. You should note that Excel adds it under the existing Profit field in the Values box and to the right of the Sum of Profit column in the PivotTable. h. Click the drop-down menu on the Sum of Profit field in the Values box and select Move Down. i. Drag the SalesAmount field in the Sales table into the Values box. Click on the chart, and then place a check next to the SalesAmount field in the Sales table. j. Click the drop-down menu on the Sum of SalesAmount field in the Values box and select Move to Beginning. k. On the PivotTable, select the cell with the text Row Labels (it should be cell A16). Change the value to Class / Channel. l. Change the Sum of SalesAmount column header to Sales Amount. m. Change the Sum of TotalCost column header to Total Cost. n. Change the Sum of Profit column header to Profit. The headers should now all be changed. o. Highlight all of the cells in the PivotTable that contain numeric figures.

Page 10 of 17

Power Pivot Tasks Detailed Steps

p. Click the Home tab on the Ribbon followed by the $ symbol to format the selected values. q. Next, click the Format button and from the drop-down menu, choose the AutoFit Column Width command.

r. Select the PivotChart s. In the Task Pane, scroll to the bottom of the list of tables until you find the Sales table. Find the Profit field and place a check next to it. t. Find the ClassName field in the DimProduct table. Drag and drop it into the Axis Fields box. u. Next, find the ChannelName field in the Channel table. Drag and drop it into the Axis Fields box. v. On the PivotChart, select the Y Axis label (click the values to the right of the chart so that a selection box is around them) then right click and select Format Axis. w. In the Format Axis dialog, change the Display units to Thousands.

Page 11 of 17

Power Pivot Tasks Detailed Steps

x. Choose the Number option from the list of pages. y. Choose Currency from the Category list. z. Change the Decimal places to 0 and click Close.

aa. Select the chart title Total and change it to Total Profit. bb. If you would like to resize the chart, click the right side of the charge on the grab handle. Drag to left until it is the width that you desire. 2. Configure Data Slicers for the PivotTable and PivotChart a. In the Task Pane, locate the GeographyKey field under the DimStore table. Drag and drop it to the Slicers Horizontal box. b. Find the PromotionName field in the DimPromotion table. Drag and drop it to the Slicers Vertical box. c. Finally, locate the Manufacturer field in the DimProduct table. Drag and drop it to the Slicers Vertical box. d. Right click on the Horizontal Slicer: GeographyKey, and select Slicer Settings. e. Change the Caption from GeographyKey to Country and click OK. f. Repeat the process and change the title of the first Vertical Slicer from

Page 12 of 17

Power Pivot Tasks Detailed Steps PromotionName to Promotion.

g. In the Country slicer, select only one of the fields such as 731. 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. h. Close Excel by clicking the File and select Exit. i. If prompted to save your changes, do so. Excel will close the PowerPivot Client Window.

Page 13 of 17

Power Pivot

Exercise 3 Load Data from the Web


Scenario
In this exercise, you load data from the web. PowerPivot supports a variety of data sources including data feeds. However, it can easily let you import plain-old-HTML.

By the end of this exercise, you will understand: How to create a pivot table and chart report connected to PowerPivot Use data slicers to filter data Tasks Complete the following task on: MIAMI 1. Product information or explanation about a certain feature goes here c. Detailed Steps a. b. Start Internet Explorer by clicking Start | All Programs | Internet Explorer. Navigate to http://localhost:999/table5.htm. This is a local copy of data from the Energy Information Administration captured in September of 2009. You can click one of the three tabs (Residential, Commercial, and Industrial) to see the different data.

Page 14 of 17

Power Pivot Tasks Detailed Steps

d. e.

Select the Residential tab. Using your mouse, select the column headers and data down to VT (Vermont).

f. g. h. i. j. k. l.

Right click and select Copy from the context menu. Click Start | All Programs | Microsoft Office | Microsoft Excel 2010. Click the PowerPivot tab, click PowerPivot Window. On the Home tab on the PowerPivot Ribbon, select the Paste button. Click OK. Switch back to Internet Explorer. Using your mouse, select the column headers and data down to for the Middle Atlantic group.

Page 15 of 17

Power Pivot Tasks Detailed Steps

m. Right click and select Copy from the context menu. n. o. Switch back to the PowerPivot Client Window. Select Paste Append from the Ribbon.

p. q. r. s.

In the Past Preview dialog, review the data and then click OK to load the data. Select the Number of Consumers column. Click the Column tab on the Ribbon. From the Format combo-box, select Whole Number.

t. u. v.

Select the Average Monthly Bill Dollar and cents column. From the Format combo-box, select Currency. With the Average Monthly Bill Dollar and cents column selected, right click and select Rename Column from the context menu.

w. Change the column name to Average Monthly Expense. Page 16 of 17

Power Pivot Tasks Detailed Steps x. y. z. Rename the Average Retail Price Cents per Kilowatthour column to Average Retail Price kWh. Switch back to Internet Explorer. Using your mouse, select the entire table starting from the table headers.

aa. Right click and select Copy from the context menu. bb. Switch back to the PowerPivot Client Window. cc. Click Home tab, Select Paste Replace from the Ribbon. dd. In the Paste Preview dialog, accept the defaults and click OK. Notice how your column names and formatting remains. ee. Switch to Excel. ff. Close Excel by clicking the File menu and select Exit. gg. If prompted to save your changes, select Dont Save. Excel will close the PowerPivot Client Window. hh. Close Internet Explorer. You have now completed this lab.

Page 17 of 17

You might also like