Você está na página 1de 5

Powerpivot extends the capabilities of the Pivot table data

summarization and cross-tabulation feature with new features such as


expanded data capacity, advanced calculations, ability to import data
from multiple sources, and the ability to publish the workbooks as
interactive web applications.
We use PowerPivot to:
Import data from multiple sources.
Create linked data.
Create relationships between data from different sources.
Rename columns, and create calculated columns.
Create hierarchies.
Create PivotTables and PivotCharts.
Add Slicers.
Create a measure and KPI.
Create perspectives.
Save the resulting Excel spreadsheet.
Import data from multiple sources
PowerPivot supports importing data from a variety of sources,
including: SQL Server databases, Analysis Services cubes, Access
databases, Excel worksheets, text files, data feeds, and more. We can also
import data by pasting it from an Excel worksheet or by linking directly
to an Excel worksheet.
1. Add Data by Using the Table Import Wizard
2. Add Data by Using a Custom Query
3. Add Data by Using Copy and Paste
4. Add Data by Using an Excel Linked Table
Addition of Data by Using the Table Import Wizard
PowerPivot can import data from a variety of relational sources:
Access, Oracle, Sybase, Informix, DB2, Teradata, and more. The process
for importing data from each of these relational sources is described
below.
1. Create a connection to an Access database
2. Filter the table data prior to importing
3. Import the selected table and column data
Addition of Data by Using a Custom Query
In this method, we connect to a Microsoft Access database and use
a custom query to import data into PowerPivot workbook. An Access
database is a relational data source. PowerPivot can import data from a
variety of relational sources: SQL Server, Oracle, Sybase, Informix, DB2,
Teradata, and more.
Importing data from the Access database involves connecting to
the database, locating the query file, and running the query to import the
data into powerpivot workbook. We have to create relationships between
the data from the Access database and the other data in
PowerPivot workbook in order to use this data in analysis.
The Table Import wizard guides us through the steps. We can either
import a query, copy and paste the text of an existing query, or write a
new query by using the PowerPivot graphical query builder.
Add Data by Using Copy and Paste

1. Navigate to the location on computer where the data is stored,


then double click on file. A new Excel worksheet opens, and we are
no longer in the PowerPivot window.
2. Highlight and copy cells.
3. Back in PowerPivot window, on the Home tab, click Paste.
4. The Paste Preview dialog box displays the new table that will be
created.
5. Type in the Table Name in the text box.
Make sure that the table data is correct; make sure to use first row, as
column headers is selected, and then click OK. The new table is created
in the PowerPivot window. Make sure to select only this range of cells and
not whole rows and columns. Selecting whole rows and columns imports
empty cells, which might affect ability to create relationships with this
data.
Add Data by Using an Excel Linked Table
In the previous method the table is static because after we pasted
the data, it is not automatically updated. Linked tables, on the other
hand, automatically reflect changes that made to the source. Linked
tables must refer Excel data found in a separate Excel window within the
same Power Pivot workbook.
To save Power Pivot workbook
1. In the Excel window, click the File tab.
2. Click Save As. The Save As dialog box opens.
3. We will save the workbook as the default file type of Excel
Workbook (*.xlsx). In the File name text box, type the name, and
then click Save.
In order to perform any meaningful analysis, data sources must
have relationships between them. More specifically, relationships enable
us to:
Filter data in one table by columns of data from related tables.
Integrate columns from multiple tables into a PivotTable or
PivotChart.
Easily look up values in related tables using Data Analysis
Expressions (DAX) formulas.
To review existing relationships
1. In the PowerPivot window, on the Design tab, in
the Relationships group, click Manage Relationships.
2. In the Manage Relationships dialog box, we should see the
following relationships, which created when the first Access
database was imported:
3. Notice that we can create, edit, and delete relationships from this
dialog box. Click Close.
4. Create New Relationships between Data from Separate Sources
Create Relationships in Diagram View
In Diagram View, we can easily create relationships between
columns in separate tables. The relationships appear visually, which
enables us to quickly see how all the tables relate to each other.

Hierarchies
Tables can include dozens or even hundreds of columns. Because of
this, client users might have difficulties finding and including data in a
report. The client user can add the entire hierarchy (consisting of
multiple columns) to a report in only one click. Hierarchies can also
provide a simple, intuitive view of the columns. For example, in a Date
table, we can create a Calendar hierarchy. Calendar Year is used as the
top-most parent node, with Quarter, Month, and Day included as child
nodes (Calendar Year->Quarter>Month->Day). This hierarchy shows a
logical relationship from Calendar Year to Day.
Hierarchies can be included in perspectives. Perspectives define
viewable subsets of a model that provide focused, business-specific, or
application-specific viewpoints of the model. A perspective, for example,
could provide users a hierarchy of only those data items necessary for
their specific reporting requirements.
Create a Hierarchy
We can create a hierarchy by using the columns and table context
menu or by using the Create Hierarchy button on the table header in the
Diagram View. When we create a hierarchy, a new parent node appears
with the columns we selected as child nodes.
When we create a hierarchy, we create a new object in model. We
do not move the columns into a hierarchy; we create additional objects. A
single column can be added to multiple hierarchies.
Edit a Hierarchy
We can rename a hierarchy, rename a child node, change the order
of the child nodes, add additional columns as child nodes, remove a child
node from a hierarchy, show the source name of a child node (the column
name), and hide a child node if it has the same name as the hierarchy
parent node.
Delete a Hierarchy
If we want to delete a hierarchy at some point, follow these steps.
1. To delete a hierarchy and remove its child nodes
2. While still in Diagram View, right-click the parent hierarchy
node, Hierarchy Example 2, and then click Delete. (Or, we can click
the parent hierarchy node and then press Delete.) Deleting the
hierarchy also removes all the child nodes.
3. Click Delete from Model in the dialog box to confirm the action.
Add a PivotTable
Always create PivotTables from the PowerPivot window or the
PowerPivot tab in the Excel window. There is also a PivotTable button on
the Insert tab in the Excel window, but standard Excel PivotTables cannot
access PowerPivot data.
Delete a PivotTable
If we want to delete a table at some point, follow these steps.
1. Click inside the PivotTable.
2. In the PivotTable Tools tab, select Options.

3. Select Entire PivotTable. On the Home ribbon select Delete and


then click Delete Sheet.
Slicers
In PowerPivot, we drag the slicer fields to either the Slicers
Vertical or Slicers Horizontal field. If we have something with a long list
of values, put it in Slicers Vertical. Items with short lists should go into
Slicers Horizontal.
When we add slicers using the PowerPivot Field List, the
PowerPivot add-in actually shifts the pivot tables down and/or right to
make room for the slicers. PowerPivot decides how many columns would
look best in the slicer. It does not choose a different color for each slicer,
but you can easily do that using the Slicer Tools Options ribbon tab.
Be default, PowerPivot makes the slicers filter all the pivot tables
and pivot charts. Someone who is very proficient in Excel might figure
out how to achieve this in regular Excel, but PowerPivot does it
automatically.
Measures
A measure is a numeric calculation used in data analysis. Examples
that are commonly found in business reports include sums, averages,
minimum or maximum values, counts, or more advanced calculations that
you create using a DAX formula. In a PivotTable or PivotChart report, a
measure is placed in the Values area, where the row and column labels
that surround it determine the context of the value. For example, if we
are measuring sales by year (on columns) and region (on rows), the value
of the measure is calculated based on a given year and region. In a
PivotTable or chart, the value of a measure always changes in response to
selections on rows, columns, and filters, allowing for ad hoc data
exploration.
Once we use a measure as a KPI, you cannot use it for other
calculations; you must make a copy if you want to use the formula in
calculations as well. Creating a measure is a requirement for creating a
KPI.
KPIs
A Key Performance Indicator (KPI) is based on a specific measure
and is designed to help the end user evaluate the current value and
status of a metric against a defined target. The KPI gauges the
performance of the value, defined by a Base measure, against
a Target value, also defined by a measure or by an absolute value. In
business terminology, a KPI is a quantifiable measurement for gauging
business objectives. For example, the sales department of an organization
might use a KPI to measure monthly gross profit against projected gross
profit. The accounting department might measure monthly expenditures
against revenue to evaluate costs, and a human resources department
might measure quarterly employee turnover. Each is an example of a KPI.
Business professionals frequently consume KPIs that are grouped
together in a business scorecard to obtain a quick and accurate historical
summary of business success or to identify trends.
One of the requirements for creating a Key Performance Indicator
(KPI) is to first create a base measure that evaluates to value. We will
then extend the base measure to a KPI. Create KPI is only available for

measures that we create using the approaches previously described. If


we create a measure in Excel, by dragging a field from a table to the
Values area in the PowerPivot field list, that measure is an implicit
measure and cannot be used as the basis of a KPI.

Você também pode gostar