You are on page 1of 47

SQL Server 2008 R2 Power Pivot RC

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.

2 © 2021 Microsoft Corporation. All rights reserved.


About the Author
Author: Laura Jones
Bio: Brian A. Randell is a senior consultant with MCW
Technologies, LLC. For over 20 years, Brian has been building
software solutions and educating his fellow developers.
Brian spends his time teaching Microsoft technologies to
developers, working with new and emerging technologies
like Visual Studio 2010, Team Foundation Server 2010, SQL
Server 2008 R2, and SharePoint 2010, and consulting
worldwide for Fortune 500 companies like Microsoft, state
and local governments, and small businesses. Brian enjoys
helping people get the most out of their software. He does
this through training for MCW Technologies and speaking at
events such as VSLive!, Tech·Ed, and the PDC. In addition,
Brian shares through the written word. Brian currently writes
the Team System column for MSDN Magazine. He is the
author and lead instructor of MCW Technologies Core Team
System and Core Windows SharePoint Services courses. You
can reach Brian via his blog at
www.mcwtech.com/cs/blogs/brianr.
Table of Contents
Lab Environment............................................................................................................................................................. 1
Lab Overview.................................................................................................................................................................... 2
Exercise 1: Getting Started.......................................................................................................................................... 3
Exercise 2: Work with Data......................................................................................................................................... 4
Exercise 3: Load Data from the Web....................................................................................................................... 4
Appendix............................................................................................................................................................................. 4

4 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

Lab Environment
During this lab, you will work in a simulated environment with the following computers
or virtual machines.

Computers and virtual machines used in this lab

Icon Computer Name Description


We have configured this virtual machine as a
domain controller running Windows Server 2008
R2 Enterprise Edition with following products
installed:
MIAMI
 SQL Server 2008 R2 RC0
 SharePoint 2010 RC
 Office 2010 RC

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

1 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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

Estimated time to complete this lab: XX minutes

2 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

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 PowerPivot Add-in for Microsoft Office Excel 2010.

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

Task Detailed Steps

Complete these steps by connecting to the computer MIAMI

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

3 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

2. In the Server name field, enter (local)\POWERPIVOT.


3. In the Database name combo-box, select ContosoRetailDW from the list.
The wizard automatically creates a Friendly connection name.

4. Click the Next button to continue the running the wizard.


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

4 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

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

5 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

8. Now also select the DimGeography table.


9. Move back down and select the FactSales table row. Click the Preview and
Filter button. The wizard opens a new window where you can filter the data
that it imports.

6 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

10. Remove the check for the SalesKey column.

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

7 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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.

8 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

15. Click Finish to start the import and prepare process.

As the import process progresses, the dialog provides you with


information about the number of rows transferred.

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.

9 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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.

17. Click OK to close the Details dialog.


18. Click the Close button to close the wizard and return the PowerPivot for
Excel client.

10 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

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.

22. Select Add Column.


23. In the formula bar enter =[SalesAmount] - [TotalCost] and press Enter.
PowerPivot creates the new column and updates the screen with your
calculation. This is a simple example of a Data Analysis Expression. You’ll work
with them more in a later exercise.

11 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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.

12 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

27.Change the path to Documents Library and name the file


ContosoSales.xlsx and click Save.

28. Once PowerPivot has saved the file, continue to the next exercise.

13 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

Exercise 2: Work with Data


Scenario
In this exercise, you’ll create a sales report in Excel 2010 using PowerPivot as your in-memory data
source containing almost 3.5 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

Task Detailed Steps

Complete these steps by connecting to the computer MIAMI

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.

14 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

3. In the Create PivotChart and PivotTable (Vertical) dialog, choose the


Existing Worksheet option and click OK.

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.

15 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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.

16 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

8. Place a check next to the SalesAmount field in the Sales table.


9. Click the drop-down menu on the Sum of SalesAmount field in the Values
box and select Move to Beginning.
10.On the PivotTable, select the cell with the text Row Labels (it should be cell
A16). Change the value to Class / Channel.
11. Change the Sum of SalesAmount column header to Sales Amount.
12. Change the Sum of TotalCost column header to Total Cost.
13. Change the Sum of Profit column header to Profit. You will now have
changed all of the headers.

14. Highlight all of the cells in the PivotTable that contain numeric figures.

17 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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.

17. Select the PivotChart (Chart 1).


18. In the PowerPivot Field List, scroll to the bottom of the list of tables until

18 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

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.

23. Choose the Number option from the list of pages.


24. Choose Currency from the Category list.
25. Change the Decimal places to 0 and click Close.

26. Select the chart title Total and change it to Total Profit.

19 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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.

20 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

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.

You’ve now formatted your chart nicely.

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.

21 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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

22 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

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.

23 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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.

8. Select File | Save.

24 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

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.

25 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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:

 Load data from an external web site


 Format the data in PowerPivot

Task Detailed Steps

Complete these steps by connecting to the computer MIAMI

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.

26 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

2. Select the Residential tab.


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

4. Right click and select Copy from the context menu.


5. Click Start | All Programs | Microsoft Office | Microsoft Excel 2010.
40. Click the PowerPivot tab then the PowerPivot button.

4. On the Home tab, on the PowerPivot Ribbon, click the Paste button in the
Clipboard group.

27 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

5. In the Paste Preview dialog, remove the check next to the Use first row as
column headers (if checked) and click OK.

6. Switch back to Internet Explorer.


7. Using your mouse, select the column headers and data down to for the
Middle Atlantic group.

8. Right click and select Copy from the context menu.


9. Switch back to the PowerPivot for Excel window.
10. Select Paste Append from the Ribbon.

28 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

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

29 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

11.If prompted to save your changes, select Don’t Save. Excel will close the
PowerPivot for Excel window.
12. Close Internet Explorer.

30 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

Exercise 4: SharePoint Integration


Scenario
In this scenario, you use some of the rich SharePoint 2010 integration features available to you
when saving your PowerPivot workbooks to SharePoint.

By the end of this exercise, you will understand:

 Publish your PowerPivot Application to SharePoint


 Access your PowerPivot Application from SharePoint
 Administer your PowerPivot Application

Task Detailed Steps

Complete these steps by connecting to the computer MIAMI

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.

5. Under the Document Libraries, double-click the PowerPivot Gallery item. If

31 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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.

32 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

15. Under the Current View, expand the drop down and select Theater.

SharePoint changes the view and Silverlight displays your workbook in a


new rich format.

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.

33 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

18. Click Italy in the Country slicer. Notice the data chart updates.

If you receive an error:

Then you need to start the Claims to Windows Token Service.


To do this, click Start | Administrative Tools | Services.
In the Services MMC, right click on the Claims to Windows Token Service
and select Start.

34 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

Close the Services MMC and return to Internet Explorer.


Now click the Italy Country slicer again. It might take a few seconds to
refresh.
19. Click the PowerPivot Gallery link to return to the document view.

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.

21. Check the Enable box.


22. Check the Also refresh as soon as possible box.
23. Change the Earliest Start Time to the nearest 15 minutes before the
current time and then click OK.
As an Administrator, you can monitor data refresh via the PowerPivot
Management Dashboard.

35 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

24.Click Start | Microsoft SharePoint 2010 Products | SharePoint 2010


Central Administration.
25. Click Yes when prompted by UAC.
26. Once the Central Administration site opens in a new browser window, click
the General Application Settings link.

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.

More PowerPivot Dashboard


PowerPivot is all about self-service BI. However, IT administrators need to
be able to monitor usage and understand self-service BI activity. The
PowerPivot Management Dashboard, that’s Microsoft integrated into
SharePoint Central Administration, lets you do that.

36 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

34.Click Start | Microsoft SharePoint 2010 Products | SharePoint 2010


Central Administration.
35. Click Yes when prompted by UAC.
36. Once the Central Administration site opens in a new browser window, click
the General Application Settings link.

37. Scroll down the page and select the PowerPivot | Management Dashboard
link.

Internet Explorer opens the Dashboard. Note: your Dashboard won’t


match the screen shots due to temporal differences. The dashboard
includes a variety of indicators that you can use to monitor the health of
your PowerPivot service.

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.

37 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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.

The Actions web part provides links to other location in SharePoint


Central Administration site.
The Workbook Activity – Chart web part provides a bubble chart that
shows the frequency of data access. You can figure out how many users
connect to PowerPivot data sources and how many queries they executed
on a daily or weekly basis.
39. You can click the play button to play an animation of usage on the
Workbook Activity – Chart web part. You can also grab the thumb and scrool
yourself

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.

38 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

Exercise 5: Data Access Expressions


Scenario
In this scenario, you will investigate the Data Analysis Expressions (DAX) language, another new
feature of PowerPivot. DAX is a crucial component in for self-service BI. As you’ll see, DAX uses an
expression syntax that is very similar to that used by Excel.

By the end of this exercise, you will understand:

 How to combine data from multiple columns


 How to related data from different tables
 How to evaluate data with static values
 How to calculate data across multiple columns

Task Detailed Steps

Complete these steps by connecting to the computer MIAMI

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

39 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

textual data from columns.


11. Select the DimStore table.

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.

40 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

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.

20. Change the column header to Row Count by Channel.


You can combine RELATEDTABLE with other functions too.
21. Switch to the DimPromotion table by clicking its tab at the bottom.
22. Now let’s add a column that provides multiple values based upon data in
other columns. Add a new column by adding the following DAX formula to the
formula bar and press Enter when done:
=IF(DimPromotion[DiscountPercent] <
0.1,"Small",IF(DimPromotion[DiscountPercent] >= 0.1 &&
DimPromotion[DiscountPercent] < 0.3,"Medium","High"))

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])

41 Microsoft Confidential - For Internal Use Only


SQL Server 2008 R2 Power Pivot RC- Exercise 5: Data Access Expressions

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])

27. Now, switch to the DimGeography table.


28. Add a new column here using the same formula::
=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.

42 © 2021 Microsoft Corporation. All rights reserved.


SQL Server 2008 R2 Power Pivot RC- Appendix

Appendix
Labcode Manual Version Last Update
Version 154 4/2/2010 9:23:00 AM

Lab Notes
Description Details

Virtual Machine Requirements


Virtual Machine Name Details
MIAMI Self-contained domain controller with SQL Server 2008 R2, SharePoint 2010, and Office
2010.

43 Microsoft Confidential - For Internal Use Only

You might also like