Вы находитесь на странице: 1из 20

There are a lot of possible ways Power Pivot can retrieve data, from:

– Excel Tables

– Text files (Tab-delimited, CSV files)

– Clipboard

– Databases (SQL Server, Access, Oracle, MySQL to name a few)

– MS SQL Server Reporting Services (SSRS)

– Online sources (Azure)

STEP 1: Select your data. Go to Insert > Table. Click OK.

STEP 2: Go to Design > Table Name and give your new table a descriptive name. In our
example, we give it the name of Sales.

STEP 3: Go to Power Pivot > Add to Data Model. This will import your new table into
the Power Pivot Window.
STEP 4: This will open Power Pivot Window. Your data is now ready.
Other way

STEP 1: Open the Power Pivot Window. Go to Power Pivot > Manage.

(For Excel 2010, go to PowerPivot > PowerPivot Window)


STEP 2: This will open the Power Pivot Window. Go to Home > Get External Data >
From Other Sources.

STEP 3: In the Table Import Wizard, pick Excel File and click Next.
STEP 4: Browse for the Excel workbook that has your data.

Make sure check the Use first row as column headers checkbox i.e. Since our data has
column headers.

STEP 5: Select your file and click Open.


STEP 6: Click Next.
STEP 7: Make sure the Source Table from the imported Workbook is selected.
You can also click on the Preview & Filter button (bottom right hand corner) to choose or
filter specific columns & data that you want to import:
When you have made your selection, click OK and then select Finish in the next screen.

STEP 8: You will get the following Importing Success dialogue box which shows the
number of rows that have been imported. Click Close.
STEP 9: Your data is now ready for analysis using Power Pivot.
Power Pivot is an Excel add-in which can used to perform powerful data analysis and
create sophisticated data models. It can handle large volumes of data (millions of rows)
from various sources and all of this within a single Excel file.

o install the Power Pivot add-in:


1. Go to File > Options > Add-Ins

2. In the ‘Manage:’ box, change the drop-down to ‘COM Add-ins’ -> ‘Go…’

3. Check the ‘Microsoft Power Pivot for Excel’ box, and then click OK. If you have
other versions of the Power Pivot add-in installed, those versions are also listed in the
COM Add-ins list.

4. Once Power Pivot is enabled, you’ll be a tab named PowerPivot and you’ll be able to
see the shown options here when you click on it:

Power Pivot Example Data Workbook


1. Once you have saved the file and opened that, you’ll notice that there are two tabs.
One, data tab and the other mapping tab.
2. The data tab has the sales info as shown in the screen shot below. The data tab
contains detailed data showing sales by country, by product type, by quarter, by sales
channel etc. The mapping tab contains that data sub-totaled by quarter, also seen
below.Data Tab:
Mapping Tab:
3. The mapping tab has a table showing a method of “mapping” or a lookup table that
allows you to change from the quarter notation to the year and/or the quarter. This can
also be derived using formula in Power Pivot as well!
4. First, let’s see how we can add the two tables into the data model. Make sure you
have selected the range of the Data table then select the Add to data model button
from the Power Pivot Tab:

5. You’ll notice a new pop-up window opens. It is the Power Pivot window, it has
several options to edit, modify and update the data model

6. Go back to the Excel file and Repeat the steps 4 and 5 with the data in the Mapping
tab to add that to the data model.
7. Please note that for each data added onto the Data Model, a new tab is created in the
Power Pivot tab

Creating Relationships
Now that we have two datasets added to the data model. Let’s look at how we can create a
relationship between the two.

1. The common field between the two datasets will be used to create the relationship
between them
2. In this example, Quarter from the Data table is the same as QuarterCode from the
Mapping table
3. To create a relationship between the two data sets, click on Create Relationship under
the Design tab of Power Pivot window
4. This opens a pop-up where you’ll need to select the main table, the lookup table and
the corresponding columns
5. In the current example, the Data table is our main table and the common column is
The Mapping table is our Lookup Table and the Related Lookup Column is
QuarterCode. Hence the following selections needs to be made in the pop-up

6. Click on Create once you’ve done this and you will create the relationship between
the two tables
7. To view the relationships and check that it is correct, we can use the Diagram view.
Click on Diagram View in the Home tab

8. It shows the relationship created, as shown below


9. To go back to the normal view of data tables in the Power Pivot window click Data
view in the Home tab.

You can create a relationship in Diagram View once you get more comfortable with this
process.

To do this you click on the common column in one data set and drag it onto the
corresponding column in the other table, all the while keeping the mouse button clicked.

Now we’ve created a very simple data model let’s look at creating some calculated columns.
For more on

Calculated Columns in Power Pivot


In this section, you’ll learn how to create calculated columns in Power Pivot.

First make sure that you are in the Mapping tab of the Power Pivot window

1. Now, let’s explore how we can derive the year and quarter using just the Quartercode
column in the Mapping tab to keep this example very simple.
2. In the default view, you can see there is a column as “Add Column” as the Header of a
column which doesn’t contain any data.

3. To name the column, double click on “Add Column” and type in a relevant name.
The first empty box below the column header can be used to fill in the formula for the
column.
4. Let’s add a column called “Year Derived” and use the following formula to get it
from the data in the QuarterCode column:=VALUE(LEFT([QuarterCode],4))

5. Almost all of the formulas in Power Pivot are the same as they are in Excel.
In this example, first we take the first four characters from the QuarterCode using the
LEFT function and then use the VALUE function to convert the string of characters
into a number. See this video for more details on working with text functions.
6.
1. Next we add another column called “Quarter Derived” and use the following
formula

=VALUE(RIGHT([QuarterCode],1))

Similar to the formula in the “Year Derived” column, this formula takes the last digit
of the string in the QuarterCode column and converts it into a number.

Вам также может понравиться