Pivot Tables and Beyond Data Analysis in Excel 2013 - Course Technology Computing Conference
Presenter: Patrick Carey, Cengage Learning Author
Excel is sometimes called the most popular "database" in the world, not because it's a database but because it makes data so accessible that users often turn to spreadsheets for data entry. Yet for all that, Excel's tools for data analysis and modeling remain largely untapped by the average user. In this, pivot tables may be the most powerful and least utilized tool for data exploration. In this presentation we'll examine some of the new enhancements to pivot tables introduced in Excel 2013. We'll examine how to set up relationships using the Excel Data Model to summarize information across multiple data tables. And then we'll go beyond, exploring the data modeling and data visualizing tools provided by the PowerPivot and Power View add-ins, interpreting data not just numerically but through visual imagery, charts, and interactive maps.
5. Count of Product ID’s
The COUNT function of Product ID’s gives an erroneous result since the same
Product ID multiple times. We can correct this issue using the DISTINCOUNT
function available under the Excel Data Model
8. The Excel Data Model
The Excel Data Model is attached to the workbook file, providing database tools
and more compact and efficient data storage
Data Model
database
9. Data Model Overview
Benefits
• Ability to Define Relationships
between Multiple Tables
• Data Compression
• Support for DAX
• Interfaces with Dashboarding
Tools like Power View
Limitations
• Built-in Tools Missing from Pivot
Table Menus
• Inability to Group Fields
• Supported only in Excel 2013
10. Adding an Excel Table to the Data Model
You can add a table to the Data Model when you generate the Pivot Table, by
clicking the Add this to the Data Model checkbox
11. Distinct Count of Product ID’s
The DISTINCOUNT function available under the Excel Data Model counts each
unique occurrence of a Product ID in the Sales table; from this we know that
212,720 units were sold from 35 different GJC products over the past 4 years.
12. Adding a Second Table
To use information from a second table, it has to be added to the Data Model and
a relation established between the two tables.
15. PowerPivot Features
• View, edit, sort and filter data in
the PowerPivot grid
• Perform Calculations using DAX
• Set up table relations with a
graphic interface
• Set default display formats for
data columns
• Hide Columns and Tables
• Create hierarchies of data
columns
• Define Key Performance
Indicators (KPI’s)
• Analyze Big Data containing
Millions of Records
17. Importing Database Tables into the Data Model
Multiple database tables can be imported into the Data Model. Power Pivot will
retain any table relations already defined in the database.
18. Table Relationships within Diagram View
Diagram is useful for viewing the complete structure of your data model, including
all relationships, hierarchies, and KPI’s. Here Sales Date in the Sales table and Date
in the Calendar table are linked
19. Setting Column Sort Order
Sorting Months by Month Number Sorting Weekdays by Weekday Number
20. Units Sold by Year and Month
It’s important to define the sort order for the Year and Month fields so they are
sorted in the correct order.
22. DAX
• Data Analysis Expressions
• Calculations based on
Tables and Columns
• Support for Lookup Tables
and Table Relations
• Optimized Memory Engine
supports Rapid Calculations
over Large Columns and
Tables
23. PowerPivot Calculations
Calculated Columns
• Calculation context is row-based
• Formulas are applied to an
entire column
• Appear as a new columns within
PowerPivot Data View
Calculated Fields
• Calculation is based on the
PivotTable context
• Called measures in PowerPivot
2010
• Appear in the Calculation Area
in PowerPivot Data View
24. Calculating Revenue from Each Sale
To calculate the revenue from each sales use the Unit Price field round in the
Products table using the RELATED function to access the field value
Revenue:= [Units Sold]*RELATED([Products[Unit Price])
25. Total Revenue by Month and Year
Calculated Columns appear in the list of table columns alongside data fields and
can be directly used in any Pivot Table combination we wish.
26. Calculating the Total Store Days
GJC is not open every day, so we create the StoreDays calculated field to count up the
number days minus the number of holiday dates from the Holidays table.
Store Days := COUNT([Calendar[Date]) – COUNT(Holidays[Date])
27. Calculating Average Daily Revenue
The average revenue collected day can be inserted as a calculated field using the DAX
expression:
Daily Revenue := SUM([Revenue])/[Store Days]
28. Daily Revenue from the GJC Stores
Overall the store earns an average of about $7,600 per day for the selected
products. Individual stores earn anywhere from $58 up to more than $440 per day.
30. Defining a KPI against an Absolute Standard
KPI’s provide a visual indicator of how a base field performs versus a defined
standard. Here we set an absolute value for Daily Revenue with “normal” or
”acceptable” ranging from $80/day to $160/day
31. Viewing a Key Performance Indicator
High performance values are indicated by a green ball, low performance by a red
ball, and values within the target area are highlighted with the yellow ball.
32. KPI’s can Lose their Meaning when the Data is Filtered
An absolute standard loses its meaning when the data values filtered. In this almost all
stores appear to be underperforming when measured against an absolute standard
that should apply only when all product categories are included.
33. Calculate the Number of Brick & Mortar stores
We want to compare each Brick & Mortar store to the average daily revenue from the Brick &
Mortar stores. We can do this by using a calculated field that calculates the average revenue per
store. We start by creating an expression to count the number of Brick & Mortar stores
34. Calculate the Daily Revenue from Brick & Mortar stores
Next we calculate the Daily revenue from Brick & Mortar stores only. Note that here
and in the Brick Count field we use the ALL() function to ensure that we always count
over all [City State], [City], and [StoreID] fields regardless of the Pivot Table layout.
35. Calculating Average Revenue per Brick Store
The Average Daily Revenue from the Brick Stores is calculated using the expression:
Brick Revenue Average := [Brick Revenue]/[Brick Count]
36. Creating a KPI using a Calculated Field
We now revise the Daily Revenue KPI so that it uses the Brick Revenue Average
calculated field. Low values are cut off at 40% of the target, medium values at cut
off at 80% of the target value.
37. Comparing Stores Under Different Filters
All Brick & Mortar Stores Brick & Mortar Stores by Market
38. Calculating the Maximum Daily Revenue
DAX supports a wide variety of queries and calculations. For example the above
expression uses the SUMMARIZE function to return the maximum revenue
generated on any particular day.
39. Viewing Maximum Revenue
The greatest one-day intake for the company was about $22,000 from all sources. The
greatest one-day result for the website was a little more than $10,000; from the
combined 20 Brick & Mortar stores the greatest one-day take was more than $14,000.
41. Defining a Hierarchy
Hierachies are used to group fields that have an inherit ordering. For example the
location hierarchy orders stores from Region State City
42. Viewing a Hierarchy
Hierarchies can be added to a Pivot Table, appearing as nested field. To drill down
into the hierarchy, click the [+] box.
43. Hiding Columns
You can clean up the clutter of unwanted fields by hiding them from the user;
showing only those fields which are directly involved in the data analysis. You can
also hide entire tables, such as the Holidays table, that contain only lookup values.
44. Creating Perspectives
You can reduce clutter in the Power Pivot view of the Data Model by creating a
perspectives, specifying which tables and fields are visible to the Power Pivot user.
However, modifying the perspective does not affect the table/field list in Excel.
46. Sales Report
This Power View report tracks sales for different products category by region with
each report element dynamically linked to the others.
47. Clothing Sales Report
GJC has been selling an increasing percentage of cycling clothing for women over
the past four years as this Power View report demonstrates.
48. Brick & Mortar Stores Report
This Power View report examines the Brick & Mortar stores, providing contact
information, map location, and the daily revenue.
49. Customer Report
This Power View report shows the location of Green Jersey Cycling customers and
the products they bought.