0% found this document useful (0 votes)
23 views23 pages

Excel PowerPivot

Uploaded by

André Auad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views23 pages

Excel PowerPivot

Uploaded by

André Auad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

TECHNOLOGY Excel PowerPivot

SUPPORT
SHORTCOURSE HANDOUT

Texas Tech University | Heide Mansouri


PowerPivot for Excel 2013

Table of Contents
Introduction .................................................................................................. 3

Activating the PowerPivot Add-in ........................................................................ 4

To Enable PowerPivot ....................................................................................... 4

To Add a Slicer to your Graph ........................................................................... 8

To change Order of Chart Results ..................................................................... 10

To Change chart title and remove Legend and unwanted field buttons .................. 11

To Open the PowerPivot window....................................................................... 11

PivotTable data analysis using a Data Model in Excel 2013 .................................. 12

To Import Data .............................................................................................. 12

Exploring Data Using a PivotTable .................................................................... 13

Adding ProductCategories Table to the Model ..................................................... 14

Adding Relationships Manually to Relate ProductSubcategory to ProductCategory ... 17

Adding ProductCategories table to the PivotTable ............................................... 18

Adding a Relationship using Diagram View in PowerPivot ..................................... 19

Recommended Online Resources ...................................................................... 23

Heide Mansouri Technology Support ShortCourses Page 2


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Excel PowerPivot
ShortCourse Handout

Copyright 2013 Heide Mansouri, Texas Tech University. ALL RIGHTS


RESERVED. Members of Texas Tech University or Texas Tech Health Sciences Center
may print and use this material for their personal use only. No part of this material
may be reproduced in any form without written permission from Heide Mansouri, the
author.

Introduction
Microsoft PowerPivot in Excel 2013 is an Add-in tool that can be used to perform
powerful data analysis in Excel 2013. The add-in is available in Microsoft Office
Professional Plus. PowerPivot enables you to import data from virtually any data
source, such as Microsoft Access databases, Text files, Excel files, and live data
imported from a Web sites. PowerPivot for Excel allows you to create a variety of
visual data, such as PivotTable, and PivotCharts. In both Excel and in PowerPivot,
you can create a Data Model, a collection of tables with relationships.

Data Models are created implicitly when you import two or more tables
simultaneously in Excel. However, Data Models are created explicitly when you use
the PowerPivot Add-in to import data. In the Add-in, the model is represented in a
tabbed layout, where each tab contains tabulated data.

Any data you import into Excel is available in PowerPivot, and vice versa. By using
PowerPivot you can analyze data in ways that go way beyond "regular Excel". You can get more
done in less time.

Credit: This document was adapted from Microsoft Excel 2013 Help and
Documentation.

Heide Mansouri Technology Support ShortCourses Page 3


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Course Objectives
After completing this ShortCourse, you should be able to:
 Import data from multiple sources;

 Create linked data;

 Create relationships between data from different sources;

 Perform calculations in PowerPivot;

 Rename columns;

 Create PivotTables and PivotCharts; and

 Add Slicers.

Activating the PowerPivot Add-in


The simplest way to activate the PowerPivot add-in is to just insert a
PowerView sheet from the Ribbon. This will automatically create an empty
Data Model, insert a blank PowerView canvas and activate the PowerPivot
Ribbon.

To Enable PowerPivot
 From the FILE menu, click Options -> select Add-Ins.
 In the Manage: box, click COM Add-ins -> Go…
 Check the Microsoft Office PowerPivot for Excel 2013 box, and then click
OK. After you install PowerPivot, you see a POWERPIVOT tab on the Ribbon.
 Clicking the POWERPIVOT tab displays the options available.
 Clicking the Manage in Data Model group, opens the PowerPivot Window.

Heide Mansouri Technology Support ShortCourses Page 4


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

After successfully enabling PowerPivot, the POWERPIVOT tab should appear in


Excel ribbon.

Heide Mansouri Technology Support ShortCourses Page 5


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Example: Adapted from http://www.mssqltips.com/sqlservertip/2868/powerpivot-


with-excel-2013 accessed on 9/26/2013.

Suppose that you have run a query and copied/pasted your results into the Excel
spreadsheet. And suppose that the query results look like this:

ID Team NationalChampionship
1 Alabama Crimson Tide 15
2 Tennessee Volunteers 6
3 Georgia Bulldogs 5
4 Florida Gators 3
5 LSU Tigers 3
6 Texas A&M Aggies 3
7 Mississippi Rebels 3
8 Auburn Tigers 2
9 Arkansas Razorbacks 1
10 Kentucky Wildcats 1

 Select your data -> click the PowerPivot tab -> click Add to Data Model.
On the create table dialog box, make sure you select the range for your data
and click "My table has headers" check box.
 After clicking OK, the PowerPivot window should appear.
 Click PivotTable -> PivotChart, and then select New Worksheet.
 In a graph, to see each Team and how many National Championships they
have won click on the PivotChart, and the PivotChart Fields. The list
should appear on the right side. If the Field list doesn’t appear, right click in
the Chart and select Show Field List.
 Drag Team to the AXIS box and drag NationalChampionships to the
VALUES box. This indicates that you will be reporting on each team with the
number of National Championships being the value you want to show.

Heide Mansouri Technology Support ShortCourses Page 6


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Heide Mansouri Technology Support ShortCourses Page 7


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

To Add a Slicer to your Graph


To choose between which teams to display:
 While PivotChart is selected, using the PIVOTCHART TOOLS -> on
ANALYZE tab -> Insert Slicer (or right-click on Team filed -> Add As
Slicer)
 Now, if you click on a team in the slicer, for example, Alabama Crimson
Tide, you will notice it shows results for only Alabama Crimson Tide.

 You can also CTRL + Click to select multiple teams or click the button
to set the slicer back to default.

Heide Mansouri Technology Support ShortCourses Page 8


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Heide Mansouri Technology Support ShortCourses Page 9


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

To change Order of Chart Results


By default the graph puts the teams in alphabetical order. To change the graph to
display the National Championships in order:
 Click the down arrow beside Team (on the PivotChart Fields Pane on the
right, or on the graph) and click More Sort Options…
 Change the Sort to Descending (Z to A) by: and select Sum of
NationalChampionships.

Heide Mansouri Technology Support ShortCourses Page 10


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

To Change chart title and remove Legend and unwanted field buttons
 Click on the title and rename it SEC National Championship.
 Click the chart legend, and Delete.
 To hide the field buttons, right-click the button and select “Hide Buttons”
 To change the color of the bars in the graph or style of the graph, click on
the chart and select the Design tab under PivotChart Tools.

To Open the PowerPivot window


 Click the PowerPivot tab. This is the
tab where you work with
PowerPivot, PivotTables,
Calculated Fields, and creating
linked tables.
 Click Manage (in Data Model group).
Now you’re in the PowerPivot
window. Here you can click Get
External Data to use the Table
Import Wizard to filter data as you
add it to your file, create relationships between tables, perform calculations
and expressions, and then use this data to create PivotTables and
PivotCharts.

Heide Mansouri Technology Support ShortCourses Page 11


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

PivotTable data analysis using a Data Model in Excel 2013


To build a PivotTable report in Excel that combines data from multiple tables, we
will import several tables and then use the PowerPivot add-in to refine the data
model that lives behind the report learning how to add calculations to our report.
We will use PowerPivot Sample Data available for download @
http://powerpivotsdr.codeplex.com

To Import Data
 In Excel, open a blank workbook.
 Click Data tab-> Get External Data (drop-down list)-> From Database ->
From Access
 Go to the folder that contains the Sample Data files and select
ContosoSales (in the ShortCourses folder)
 Click Open. Because you are connecting to a database file that contains
multiple tables, the Select Tables dialog appears so that you can choose
which tables to import.
 Check Enable selection of multiple tables’ box, to select all tables ->
check the Name box -> click OK twice, to create a PivotTable Report (this
may take some time). You just created a data model (implicit). The model is
a data integration layer that is created automatically when you import or work
with multiple tables simultaneously in the same PivotTable report. Now you
can view and modify this model using the PowerPivot.

Heide Mansouri Technology Support ShortCourses Page 12


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Exploring Data Using a PivotTable


Now you can explore data by dragging PivotTable Fields to the Values, Columns,
and Rows areas on the PivotTable Fields list.

 In the PivotTable Fields list scroll down until you find the FactSales table.

Heide Mansouri Technology Support ShortCourses Page 13


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

 Expand the table, and then click SalesAmount field. Because this data is
numeric, Excel automatically places SalesAmount in the Values area.
 From the DimDate table, drag CalendarYear field to Columns.
 From DimProductSubcategory table, drag the ProductSubcategoryName
field to Rows.
 From DimProduct table, drag the BrandName field to Rows, placing it
beneath ProductSubcategoryName. You now have a basic PivotTable that
includes fields from four different tables. Note: Because the tables that you
imported had pre-existing relationships among the tables, Excel recreated
those relationships in the model.

Adding ProductCategories Table to the Model


 In the workbook open a new Worksheet, to store additional data.
 Click Data -> Get External Data -> From Access.
 Go to the folder that contains the Sample Data files and select
ProductCategories.
 Click Open.
 In Import Data dialog box, select Table radio button, and click OK.

Heide Mansouri Technology Support ShortCourses Page 14


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Adding Geography data to the Model


 Insert another worksheet.
 From the Sample Data files, open Geography.xlsx
 Place the cursor in A1, and then press Ctrl-Shift-End to select all of the
data.
 Copy the data to the clipboard.
 Paste the data into the empty worksheet you just added (Don’t Deselect it).
 Click Format as Table (HOME -> Styles), choosing any style. In Format As
Table, verify that My table has headers is selected -> click OK. Formatting
the data as a table lets you name it, which will come in handy when you
define relationships in a later step.
 Name the table Geography. In Table Tools -> Design, type Geography in
Table Name.
 Close Geography.xlsx to clear it from your workspace.

Adding Stores data to the Model


Repeat the previous steps for the Stores.xlsx file, pasting its contents into an
empty sheet. Name the table Stores.
 Insert another worksheet.

Heide Mansouri Technology Support ShortCourses Page 15


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

 From the Sample Data files, open Stores.xlsx, place the cursor in A1, and
then press Ctrl-Shift-End to select all of the data.
 Copy the data to the clipboard.
 Paste the data into the empty worksheet you just added (Don’t Deselect it).
 Click Format as Table (HOME -> Styles), choosing any style.
 In Format As Table, verify that My table has headers is selected -> click
OK.
 Name the table Store. In Table Tools -> Design, type Store in Table
Name.
 Close Stores.xlsx to clear it from your workspace.

You should now have four worksheets:

 Sheet1 contains the PivotTable;


 Sheet2 contains ProductCategories data table;
 Sheet3 contains Geography data table; and
 Sheet4 contains Stores data table.

Using Fields from the Newly Imported Tables, to create a PivotTable


 On Sheet1, at the top of PivotTable Fields, click All to view the complete
list of available tables.
 Scroll to the bottom of the list. That’s where you’ll find the new tables you
just added.
 Expand the Stores table.
 Drag StoreName to the Filters area. Notice that Excel prompts you to
create a relationship. This notification occurs because you’ve used fields from
a table that is unrelated to the model.
 Click Create to open the Create Relationship dialog.
 Under Table: choose FactSales (from the drop-down list). In the sample
data you’re using, FactSales contains detailed sales and cost information
about Contoso’s business, as well as keys to other tables, including store
codes that are also present in the Stores.xlsx file you imported in the
previous step.
 Under Column (Foreign): choose StoreKey (from drop-down list).
 Under Related Table: choose Stores (from drop-down list).

Heide Mansouri Technology Support ShortCourses Page 16


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

 Under Related Column (Primary): choose StoreKey (from drop-down list).


 Click OK. Note: Behind the scenes, Excel is building a Data Model that can
be used throughout the workbook in any number of PivotTables,
PivotCharts, or Power View reports. Fundamental to this model are table
relationships that determine navigation and calculation paths used in a
PivotTable report.

Adding Relationships Manually to Relate ProductSubcategory to


ProductCategory
 In Excel, click Data -> Relationships -> New.
 Under Table: choose DimProductSubcategory.
 Under Column (Foreign): choose Table_ProductCategoryKey.accd
 Under Related Table: choose Table_ProductCategories.accbd.
 Under Related Column (Primary): choose ProductCategoryKey.
 Click OK.
 Close the Manage Relationships dialog.

Heide Mansouri Technology Support ShortCourses Page 17


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Adding ProductCategories table to the PivotTable


 In PivotTable Fields, click All to show tables that exist in the Data Model.
 Scroll to the bottom of the list.
 In the Rows area, remove BrandName.
 Expand Table_ProductCategories.accbd table.
 Drag ProductCategoryName to the Rows area, placing it above
ProductSubcategory.
 In PivotTable Fields, click Active to verify that the tables you just used are
now actively used in the PivotTable.

Heide Mansouri Technology Support ShortCourses Page 18


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Adding a Relationship using Diagram View in PowerPivot


 In Excel, click Sheet3 to make it the active sheet. Sheet3 contains the
Geography table you imported earlier. Click in a cell.
 On the ribbon, click PowerPivot -> Add to Data Model -> check the box
for My table has headers -> click OK. This step adds the Geography table
to the model. It also opens the PowerPivot add-in. Notice that the
PowerPivot window shows all the tables in the model, including Geography (at
the bottom of the window). Click through a couple of tables. In the add-in,
you can view all of the data that your model contains.
 In the PowerPivot window, in the View group (on the HOME tab), click
Diagram View. Use the slide bar to resize the diagram so that you can see
all objects in the diagram (to the right).
 Zoom in on Geography so that you can view all of its fields (right-click ->
maximize). You can use the slider to make the table diagram bigger. Notice
Geography has GeographyKey. This column contains values that uniquely
identify each row in the Geography table.
 While the Relationships window is open (Diagram View), to find out if other
tables in the model also use this key, click Find.
 In Find Metadata, type GeographyKey.
 Click Find Next several times. You’ll notice the GeographyKey shows up in
the Geography table and in the Stores table. Close the Find dialog box.
 Reposition the Geography table so that it is next to Stores table.Drag the
GeographyKey column in Stores to the GeographyKey column in
Geography. PowerPivot draws a line between the two columns, indicating the
relationship.

Heide Mansouri Technology Support ShortCourses Page 19


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Heide Mansouri Technology Support ShortCourses Page 20


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Heide Mansouri Technology Support ShortCourses Page 21


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Creating a Power View report

PivotTable reports are not the only type of report that benefits from a Data Model.
Using the same model you just built, you can add a Power View sheet to try out
some of the layouts it provides.
 In Excel, click Insert -> Power View.
 In Power View Fields, click the arrow next to the FactSales table, and
click SalesAmount (click ALL to see all tables).
 Expand the Geography table and click RegionCountryName.
 In the ribbon, click Map (Design tab -> Switch visualization). A map report
appears.
 Drag a corner to resize it. On the map, blue circles of varying size
indicate sales performance for different countries or regions.

Heide Mansouri Technology Support ShortCourses Page 22


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University
PowerPivot for Excel 2013

Recommended Online Resources


 Online Video Training Library http://library.ttu.edu/lynda
 Safari eBooks Online http://library.ttu.edu
o Excel 2013 In Depth, by: Bill Jelen, January 24, 2013
o Excel 2013 Pivot Table Data Crunching, by: Michael Alexander,
January 16, 2013

o Microsoft Excel 2010: Data Analysis and Business Modeling, 3rd


Edition, by: Wayne L. Winston, January 7, 2011

Please e-mail your questions, comments, or suggestions to [email protected]

Heide Mansouri Technology Support ShortCourses Page 23


Computing ShortCourse Coordinator IT Division Updated: 10/31/2014
Texas Tech University

You might also like