Welcome to MSDN Blogs Sign in | Join | Help

Microsoft Excel

The team blog for Microsoft Excel and Excel Services.
Using PowerPivot with Excel 2010

In this blog article, we’ll step through using PowerPivot for Excel 2010 for building a rich application in Excel.

Note: following screenshots describe the SQL Server 2008 R2 August Community Technology Preview (CTP) functionality for a feature codenamed Gemini. As recently announced, Gemini will be released under the PowerPivot brand.

After installation, Gemini appears on the Excel 2010 ribbon:

image

Importing Data

Selecting the ‘Load & Prepare Data’ button launches the PowerPivot client window:

image 

As you would expect from any modern tool, the ‘From Database’ button launches a wizard to step you through getting data from a database. More information about data import process and functionality is available on the PowerPivot blog here. For this article, we’ll bring in following tables:

  • Media – all movies our hypothetical company rents out,
  • Purchases – all purchases our customers have had in the last few years,
  • Date – details per date of purchases such as whether it was a weekend, holiday, etc.,
  • Time – time of day of purchases, and
  • BoxOffice – table of box office sales for some of the movies in the last few years

During the import process, a snapshot of all these tables is imported into PowerPivot and stored in memory using a highly scalable engine. The table Purchase, for example, contains 100 million rows. Saving the file will not only save any contents on the workbook but also all PowerPivot data. i.e. the PowerPivot data is stored as a blob within the Excel workbook to simplify transport as well as remove the management overhead of managing separate database services.

After the import, each table shows up as a tab in the PowerPivot client window. In this case, our database had relationships already defined between these tables and they were automatically recognized up by the PowerPivot Data Import Wizard. Users can, of course, define their own relationships as well.

image

The PowerPivot client window allows you to operate with this large data set very quickly: common operations such as sorting and filtering typically complete in under a second on common hardware available today (< $1000).

PowerPivot also allows you to extend imported data using calculations which are maintained through data refresh. Various types of calculations and mechanisms for creating them are described on the PowerPivot blog here.

So far, we’ve imported data only from a single source. You can, of course, combine data from a variety of data sources – databases, text files, ATOM data feeds, as well as just Copying/Pasting data directly – and create calculations and/or relationships as if they were a table imported from a single database.

Visualizing Data

Once you have the data, PowerPivot enhances the Excel experience by providing quick templates for frequently used layouts:

image

Selecting ‘Four Charts’, for example, creates a worksheet with four Pivot Charts and one worksheet each for the PivotTable source of the data, speeding up the view creation process:

image

 

PowerPivot overrides the default PivotTable Field List by providing its own Task Pane:

image

For those users familiar with OLAP Pivot Tables, there are several interesting features.

Instead of seeing dimensions and measures within measure groups, PowerPivot shows a tabular view of the data – just tables and columns. In addition, based on whether a column is dropped in the Values area or on Axis or Legend, the PowerPivot Task pane creates a measure or uses the field as an attribute. For example, if Distributor is dropped  on the Values area, a measure (Count since this is a string column) is created automatically. If, however, Distributor is dropped on AxisFields, it is used to group the data. This highlights a few points:

  1. PowerPivot leverages the richness of SQL Services Analysis Services mode internally without imposing dimensional modeling concepts on users, thereby enabling the functionality of OLAP PivotTables with a friendlier, tabular, model of the data, and without requiring IT to create and deploy Analysis Services cubes.
  2. All PivotTable and PivotChart queries are answered by the PowerPivot engine running on the desktop using data that’s stored within the Excel workbook. A connection to a server running SQL Server Analysis Services is not necessary.
  3. PowerPivot complements the richness of Excel’s visualization facilities – including tables and charts – with a rich, scalable, embeddable, data engine.

Within a matter of seconds a quick view is created…

image

 

… which can be easily made more appealing using standard Excel formatting features:

image

As mentioned earlier, saving the workbook at this point will save both the view above as well as the PowerPivot data and any enhancements such as calculations.

PowerPivot also provides helpers for adding slicers to the workbook:

image

The ‘Slicers Vertical’ and ‘Slicers Horizontal’ areas create zones on the left and top of the Pivot controls that help layout, align and resize slicers easily:

image

Summary

The combination of usability of Slicers and the performance of PowerPivot engine provides a very interactive set of views that one could easily mistake for a rich custom application built by IT after weeks of effort. This – Self Service Business Intelligence – is the key value that Gemini provides end users.

This completes a quick run through of PivotTable for Excel 2010. In the next article, we’ll dig in to PowerPivot for SharePoint to see how it enhances the SharePoint collaboration experience.

Posted: Friday, October 23, 2009 5:45 PM by Joseph Chirilov

Comments

Visvapriya said:

Hi

Thanks for the comprehensive overview.

While I like the pivoting and the slicing capabilities, i am wondering how i can track trends / find outliers or discrepencies using PowerPivot. Excel's conditional formatting was very useful here.

Can you tell us how Powerpivot supports trend analysis, status monitoring, etc...?

Thanks

Visvapriya

# October 25, 2009 10:55 AM

Frederik said:

Nice demo code.

Can we download the sample data somewhere?

Kind regards,

Frederik

# October 26, 2009 12:23 PM

Joseph Chirilov said:

Visvapriya: PowerPivot users will continue to use functionality in Excel for this behavior, the key enhancemens PowerPivot provides are ability to work with larger data sets as well as mashing up multiple tables across data sources.

Frederik: Unfortunately this demo data cannot be shared in its current form. We will release sample data likely in the next few months.

# October 26, 2009 9:06 PM

Hans Geurtsen said:

Joseph,

Thanks for this overview. This really gives us a good impression of what PowerPivot will be. I do have a few questions. I hope you can answer them to even give us a better impression!

1. I do believe PowerPivot will work very fast even on 100 million rows of data. But what impact will this have on corporate networks, often still with only 10 Mbit capacity? How fast will 100 million rows load into memory?

2. For a future article, it would be great to show something about the way users will be able to define relationships between different tables, especially when they load data into memory coming from several data sources. Can you shed a light on that?

3. PowerPivot will save the data with the workbook. What options will there be to refresh that data? And again, what will be the implications on network load? Will there be any support for the IT department to control this?

4. PowerPivot works without a connection to an SSAS instance. That's great, you don't have to create a cube first. But can you use existing cube data from within PowerPivot?

Thanks again!

Best regards,

Hans Geurtsen.

# October 27, 2009 3:12 AM

Mike said:

I'm very interested in how Excel 2010 will work with relationships as well!

Thank you!

Mike B.

of Wyndham Worldwide

# October 27, 2009 5:49 AM

Hui... said:

I know this isn't the right post to make this comment, but you've closed posting to the Charting Posts

Can you please fix the Charts object model so that we can use custom chart formats from within VBA

ie:  ActiveChart.ApplyChartTemplate ("c:\ians.crtx") doesn't work

or fix the macro recorder so that it will give us code that will actually run when played back when modifying charts

This all worked beautifully in XL 2003 and was broken in 2007 and still broken in 2010.

Hui...

# October 27, 2009 6:09 AM

Colin Banfield said:

Hui,

You submitted a bug report on Microsoft Connect and was told that the problem won't be fixed??

# October 27, 2009 8:11 AM

Scott Ruble [MSFT] said:

Hui,

In the latest build of Excel 2010, ActiveChart.ApplyChartTemplate is working correctly.  Also, macro recording of chart formatting options is supported.

Thanks,

Scott [MSFT]

# October 27, 2009 11:49 AM

sebastien said:

Hi, can all the steps you went through be automated with vba?

Tanks

Sebastien

# October 27, 2009 12:32 PM

Joseph Chirilov said:

Hans:

1. Yes, the initial import of a large data set will take time and communicate to data source over the network. The rate of data loading and the bandwidth used will depend on the type of data, server configuration as well as the capacity of the machine running PowerPivot. Frequently we see better bandwidth between SharePoint and data source machines because they’re managed by IT directly. In this case, refresh of the workbook on the SharePoint server – using PowerPivot for SharePoint – may provide a better experience.

2. An interesting part of the relationship story will be unveiled for PowerPivot’s November CTP and we will blog about the process of importing, creating and managing relationships on the PowerPivot blog in the near future.

3. In the November CTP, PowerPivot for Excel will introduce support for refreshing the snapshot from the client. Resource utilization may be smaller if only a subset of tables are re-imported. On PowerPivot for SharePoint, IT will be able to set policies for throttling data imports as well as configure the notion of business hours which allows “after hours” processing to be formalized. More details on the PowerPivot blog in the future.

4. The November CTP for PowerPivot will support importing data from Analysis Services.

sebastien: PowerPivot for Excel does not provide a scripting interface and therefore cannot be driven by VBA. We look forward to more feedback to understand how important this is as we plan the next release.

# October 28, 2009 10:35 AM

Stuart said:

Hans,

Many of us yet buying Excel 2010, do you mind to review about the pros and cons of the latest excel version, if we compare it with previous one?

Many Thanks,

Stuart Taylor

# November 1, 2009 3:58 AM

Rob Collie said:

Note that I will be showing off relationships using the CTP3 build in tomorrow's post on http://powerpivotpro.com

Still very early in the re-implementation of a professionally-built BI solution using PowerPivot.

For background on the project, here is the first post:

http://powerpivotpro.com/2009/10/27/announcing-the-great-football-project/

# November 1, 2009 8:59 PM

Tom said:

Very cool that it will count when you drop a string column into values but what about If you drop a measure on the axis, will each value slice as if it were a member of a dimension?

# November 3, 2009 1:07 PM

Tom said:

Very cool that it will count when you drop a string column into values but what about If you drop a measure on the axis, will each value slice as if it were a member of a dimension?

# November 3, 2009 1:07 PM

Rob Collie said:

Hi Tom.  I believe that if it's an OLAP pivot in Excel, Excel will prevent you from placing a measure on a slicer, just like it prevents you from placing a measure on rows or columns.

A normal Excel pivot, however, makes no distinction between measures and dimensions - every field is just a field, and can be placed anywhere.  And yes, if you place a numeric field on a slicer, you will see each unique value as a tile in the slicer.  Useful for things like Quantity, I would think.

Also note that if you are using PowerPivot, which under the hood is still really OLAP, again, we make NO distinction between field types, so you CAN place "measures" on slicers.  You can see how this "no distinction" is handled under the hood here:  http://powerpivotpro.com/2009/11/03/relationships-pivots-and-dax-the-payoff-part-one/

# November 4, 2009 7:05 AM

Colin Banfield said:

"Also note that if you are using PowerPivot, which under the hood is still really OLAP, again, we make NO distinction between field types, so you CAN place "measures" on slicers."

This dual nature of PowerPivot (acts like OLAP cubes in some ways, Excel PivotTables in other ways), may cause confusion with some users familiar with Excel's PivotTable features. For example, although you can place a PowerPivot measure in the Row or Column area, the measure is treated as text. The main reason why people place numbers in the Row or Column area is for grouping the numbers.

A similar problem exists with dates, but it's easier for the model developer to anticipate date grouping by creating common date-part calculated fields (Year, Month, Quarter etc.) in the PowerPivot source table. There's some flexibility in this approach in that you can create a whole bunch of date-parts for calendars that Excel date grouping doesn't support (fiscal, marketing, manufacturing etc.)

Other potential user interface confusion resulting from PowerPivot's OLAP nature include its sorting behavior, inability to create even text groups, enabling What-If options in the Ribbon(which it doesn't support) and disabling Summarize Value As in the Ribbon (which it does supported). These may be minor or major issues, depending on your disposition.

# November 4, 2009 9:46 AM
New Comments to this post are disabled
Page view tracker