The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by SkillForge, 2018-07-22 16:27:41

Microsoft Excel 2016 PowerPivot

2016_PowerPivot Courseware

Excel® PowerPivot 2016 51

Totals & Filters

The Totals & Filters tab includes items to customize the totals displayed on the
PivotTable. This includes options to turn on and off the grand totals by rows and
columns, include filtered items in totals and to use custom lists when sorting.

Figure 3-8 PivotTable Totals & Filters

Display

The Display tab gives you options to display the expand/collapse buttons and turn on
or off the filter drop downs. It also provides the ability to display rows or columns
with no data. The sort order of the PivotTable field list can be changed on the display
tab.

Figure 3-9 PivotTable Display

Copyright ©2017 Pathfinder Learning, LLP

52 Excel PowerPivot 2016
Printing
The Printing tab provides options that are used if the PivotTable is to be printed.
Options include: print the buttons displayed on the PivotTable, repeat row labels on
each printed page and printing titles.

Figure 3-10 PivotTable Printing

Data
The Data tab includes options to automatically refresh the data when opening the file,
retain items deleted from the data source and to allow editing of the data in the values
area.

Figure 3-11 PivotTable Data
Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 53

Alt Text

The Alt Text tab allows alternative text and explanations for visually impaired
individuals who may not understand the table.

Figure 3-12 PivotTable Alt Text

Active Field

This section will allow you to change the name of the field that is displayed on the table.
Field Settings
Based on the field that you have chosen, different options are available. For example
if you select a numeric field, the field settings dialog box will allow you to change
from a count to an average. It is also where you can change the column headings,
change the number format, etc.
Drill down/Drill Up
Options to show the children of the item selected or to go up a level, if applicable.
Expand/Collapse
The icons next to drill up are used to expand or collapse all items in the selected
field.

Figure 3-13 PivotTable Active Field

Copyright ©2017 Pathfinder Learning, LLP

54 Excel PowerPivot 2016
Group
This provides the options to group or ungroup fields in your table, if applicable. If it is not
applicable for the data in your table, it will be greyed out.

Figure 3-14 PivotTable Group

Filter
Insert Slicer will add a slicer to your PivotTable. A slicer is a way to visually filter data.
Slicers are covered in more detail in lesson five.
Insert Timeline will add a timeline to your PivotTable. A timeline is used to filter dates
interactively. Timelines make it easier to select time periods to filter the PivotTable.
Filter Connections allows you to manage the filters that are applied to the PivotTable. It
makes if faster and easier to filter the data in a PivotTable.

Figure 3-15 PivotTable Filter

Data
Data is refreshed using this option. Exercise 2-6 walked you through how to refresh data.
Change Data Source will allow you to view the existing connection properties or to change
the data source.

Figure 3-16 PivotTable Data

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 55

Actions

Clear will delete the entire PivotTable or the filters.

Select is used to choose either a portion or the entire PivotTable.

Move PivotTable is used to move the PivotTable within the workbook. It can be moved
elsewhere on the existing worksheet or to another worksheet within the workbook.

Figure 3-17 PivotTable Actions

Calculations
Options available in this group are Fields, Items & Sets, OLAP Tools and Relationships.

Figure 3-18 PivotTable Calculations

Fields, Items & Sets

Options in this section include viewing existing measures and items. Measures are
covered in lesson four. The difference between a measure and a calculated item is
that in measures there are distinct columns that you are doing something to. In
calculated items you are actually working within the field and adding, subtracting or
completing some sort of calculation to the items in the field.

Solve Order allows you to change the order in which calculations will be done.

Copyright ©2017 Pathfinder Learning, LLP

56 Excel PowerPivot 2016
Sets of data can be created or maintained under the sets option. Sets allow you to take
a sub-set of the data and name that sub-set to appear on a report.

Figure 3-19 PivotTable Fields, Items & Sets

OLAP Tools
The OLAP tools option allows you to work with a PivotTable connected to an OLAP
(Online Analytical Processing) data source.

Figure 3-20 PivotTable OLAP Tools

Relationships
Clicking on relationships will display the current relationships defined in your data
model. Once displayed, you can create new relationships, edit existing relationships,
delete relationships and even activate/deactivate a relationship.

Figure 3-21 PivotTable Relationships
Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 57

Tools

PivotChart allows the user to insert a PivotChart using the same data that was used for the
PivotTable.

The Recommended PivotTables option is only available when data is being displayed. It is
used to receive a set of PivotTables that PowerPivot believes will best suit your data.

Figure 3-22 PivotTable Tools

Show
These options will allow you to turn on and off various sections on the PivotTable
workspace. Field List will display the available fields that can be added or changed for the
current PivotTable. Buttons will add and remove buttons while Field Headers will add and
remove the headers.

Figure 3-23 PivotTable Show

Copyright ©2017 Pathfinder Learning, LLP

58 Excel PowerPivot 2016
Exercise 3-2 Use the Analyze Tab to Change Your PivotTable
Now that you have reviewed the many options available on the analyze tab, you can use some of them to
improve your PivotTable that was created in exercise 3-1. For this exercise we will be changing the name of
the PivotTable and changing the way the total sales amount is displayed. In addition, you will explore the
Show group to see the effect each button has on your PivotTable workspace.
1. If necessary, open the PivotTable that was created in exercise 3-1. Click File > Open. Locate the file in

the Class Files\Lesson3 folder. Click Exercise 3-2. Click Open.
2. Click anywhere on the PivotTable. Notice the PivotTable Tools option appears on the Excel® ribbon.
3. Click Analyze.

4. In the PivotTable group, click in the box that contains the text PivotTable1. Replace this text with the
following text: Sales by year, subcategory and brand. Click anywhere else on the table and you can
see that the PivotTable name has been changed in this field.

5. Click on one of the sales amount sums. Notice the Active Field now displays this field information.

6. Click Field Settings.

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 59
7. The Value Field Settings window will display. Click Number Format.

8. The Excel® Format Cells window will appear. Change the format to Currency with no decimal places.
Click OK.

Copyright ©2017 Pathfinder Learning, LLP

60 Excel PowerPivot 2016
9. Click OK.
10. You are now back to your PivotTable with all the numbers being converted to zero decimal places.

Excel® automatically took care of the sub-totals and grand totals also.
11. In the Show group, Click Field List. Notice the PivotTable Field List disappears. Click Field List again

and it returns.
12. Click +/- Buttons. Notice the minus sign next to the subcategories disappears. Click +/- Buttons again

and it returns.
13. Click Field Headers. Notice the column labels and row labels disappear. Click Field Headers again and

they return.

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 61
Design
The other tab available is Design. None of the changes made on the design tab will change how your
data is stored, it will only change the display of the data in the PivotTable. Design contains items to
update the layout including totals, subtotals and headers. In addition there are color options for your
layout that are called PivotTable Styles. Below is a brief description of each group on this tab.

Figure 3-24 PivotTable Design

Layout
Layout contains four different options that can change the way the PivotTable is displayed.

 Subtotals controls if the subtotals are displayed and where they are displayed.
 Grand Totals controls the overall totals for rows and columns.
 Report Layout allows the user to choose from three formats: Compact, Outline or

Tabular. It also contains a choice for repeating all labels on a PivotTable.
 Blank Rows allows a blank line to be added after each item or to turn off this option.

Figure 3-25 PivotTable Layout

PivotTable Style Options
The check boxes are quick ways to turn off and on the row and column display options.
Clicking on these boxes will immediately change the way your PivotTable looks. These
options are used in conjunction with the next section (PivotTable Styles) to fully change and
provide a more sophisticated look to your table.

Figure 3-26 PivotTable Style Options

Copyright ©2017 Pathfinder Learning, LLP

62 Excel PowerPivot 2016
PivotTable Styles
If you hover your mouse over one of the images, your PivotTable will change temporarily to
display that style. If you click on the line with the down arrow under it, you can preview all
styles that are available. To permanently change the colors and lines of the table, click on one
of the displayed images. The changes are immediately applied to your table. If you don’t like
the look, choose another one. It does not change any of the data that is displayed – only the
formatting.

Figure 3-27 PivotTable Styles

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 63
Exercise 3-3 Use the Design Tab to Change your PivotTable
Now that you have reviewed the many options available on the design tab, you can use some of them to
change your PivotTable that was updated in exercise 3-2. For this exercise you will be moving the subtotals
from the top of each group to the bottom of each group and reviewing various styles.
1. If necessary, open the PivotTable that was updated in exercise 3-2. Click on the PivotTable. Notice the

PivotTable Tools option appears on the Excel® ribbon.
2. Click Design.
3. In the Layout group, Click on the arrow under Subtotals. Click Show all Subtotals at Bottom of Group.

Notice how the subtotal is moved and the formatting of the table is changed.
4. In the PivotTable Styles group, scroll through the available styles or click the last button on the scroll bar

to see all the styles at once.
5. Move your mouse over each option and notice how it is applied to your PivotTable. Click to choose your

favorite.

Copyright ©2017 Pathfinder Learning, LLP

64 Excel PowerPivot 2016

Create a PivotChart

PivotChart Fields

When choosing one of the PivotChart options, the window will change to display PivotChart fields on
the right side of the screen. See Figure 3-28. In addition to the PivotChart fields, there are new
contextual tabs that are displayed: Analyze, Design and Format. These tabs allow for further
customization of your PivotChart and are discussed later in this lesson.

Figure 3-28 PivotChart Workspace

There are multiple sections within PivotChart fields. The Choose fields to add to report section lists
all the data sources that are in the data model. Each table is listed individually. Clicking on the arrow
to the left of the table name will expand that table so that you can select the fields. The fields will
appear with check boxes next to them. If you check the boxes, PowerPivot will add numeric fields to
the values drop zone with a sum calculation, and text fields will automatically be added to the axis
drop zone. The gear icon next to the table names allows you to customize the way the PivotChart
Fields portion of the screen will display.

The option in the bottom section that is labeled Drag fields between areas below, are called drop
zones. These drop zones are used to add, move and delete rows and columns from the PivotChart.
Table 3-3 explains each drop zone.

Drop Zone Description
Filters Fields in this zone are used to filter the data being displayed.
Legend (Series) Fields in this zone are displayed vertically on the left side of the
chart.
Axis (Categories) Fields in this zone are displayed across the bottom of the chart.
Values
A total calculation is automatically created for fields added to this
Table 3-3 PivotChart drop zones zone.

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 65
Below the drop zones is a check box that allows you to defer the automatic update of the layout of the
PivotChart. Checking this box will allow you to make all changes and nothing will be refreshed until
you click the Update button.
PivotChart

Figure 3-29 PivotChart

Figure 3-29 displays a PivotChart that was created by adding three fields from different tables to the
various drop zones. This is showing the sum of sales by year and by brand. This was created using the
same fields and data as the PivotTable earlier in this lesson. Refer back to figure 3-3. With minimal
effort, you now have a basic PivotChart that includes fields from three different tables.

Copyright ©2017 Pathfinder Learning, LLP

66 Excel PowerPivot 2016
Exercise 3-4 Create your First PivotChart
For this exercise you are going to use the data model that was created in the previous exercises to create a
PivotChart. This chart will be similar to the one displayed in figure 3-29. Notice as you add each field, the
PivotChart is updated and will show different totals and information based on the fields added so far.
1. Launch Excel®.
2. Click Blank workbook.
3. Click File > Open
4. Locate the file in the Class Files\Lesson3 folder. Click Exercise 3-4. Click Open.
5. Click Power Pivot.
6. To add a new PivotChart to the workbook, click Manage from the Data Model Group. The PowerPivot

window will display.
7. Click the arrow below the PivotTable button and click PivotChart.
8. When the Create PivotChart window opens, click OK.
9. In the PivotChart Fields list, scroll down and find the FactSales table. Click the arrow to expand the

table. Click the checkbox in front of SalesAmount. Because this amount is numeric, the field is
automatically added to the values drop zone.
10. In the DimDate table, find the CalendarYear field. Click and hold on CalendarYear to drag this field to
the legend drop zone.
11. In the DimProduct table, find the BrandName field. Click and hold on BrandName to drag this field to
the axis drop zone.
12. Congratulations! You have created your first PivotChart.

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 67

Analyze

Figure 3-30 PivotChart Analyze

There are many options available on the Analyze tab for PivotCharts. Below is a brief description of
each group on the Analyze tab. You will see a lot of similarities between these options and the ones
for PivotTables discussed earlier in this lesson.

PivotChart

The PivotChart group contains a field to quickly change the default name of the PivotChart
and Options which allows for formatting of the PivotChart.

Figure 3-31 PivotChart Group

Layout & Format

The Layout & Format tab includes options to change the way the chart displays.

 Layout includes merge and center cells with labels, display fields in report
filter and determining the number of filter fields per column.

 Format controls what value will display for errors and empty cells. It also
includes auto-fit for column widths and preserving the cell formatting when
updating the chart.

Figure 3-32 PivotChart Layout & Format

Copyright ©2017 Pathfinder Learning, LLP

68 Excel PowerPivot 2016
Totals & Filters
Totals & Filters includes items to customize the totals displayed on the PivotChart. It
also includes options to turn on and off the grand totals by rows and columns, include
filtered items in totals and use custom lists when sorting.

Figure 3-33 PivotChart Totals & Filters

Display
Display includes the options to show the expand/collapse buttons and turn on or off
the filter drop downs. It also provides the ability to display items on the axis or the
legend where the value is zero. The sort order of the PivotChart field list can be
changed on the display tab.

Figure 3-34 PivotChart Display
Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 69

Printing

Printing provides options that are used if the PivotChart is to be printed. Options
include print the buttons displayed on the PivotChart, repeat row labels on each
printed page and printing titles.

Figure 3-35 PivotChart Printing

Data
Data includes options to automatically refresh the data when opening the file, retain
items deleted from the data source and to allow editing of the data in the values area.

Figure 3-36 PivotChart Data

Copyright ©2017 Pathfinder Learning, LLP

70 Excel PowerPivot 2016
Alt Text
Alt Text allows alternative text and explanations for visually impaired individuals
who may not understand the table.

Figure 3-37 PivotChart Alt Text

Active Field
This section will allow you to change the name of the field that is displayed on the chart.

Field Settings
Based on the field that you have chosen, different options are available. This is where
you can change from a count to a sum, change the number format, etc. Also included
is a tab for Layout & Print. There are options for repeating item labels, showing items
with no data and inserting blank lines after each item label.
Drill Down/Drill Up
This gives the option to show the children of the item selected or to go up a level, if
applicable.
Expand Field/Collapse Field
This is used to expand or collapse all items of the selected field.

Figure 3-38 PivotChart Active Field
Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 71

Filter

Insert Slicer will add a slicer to your PivotChart. A slicer is a way to visually filter data.
Slicers are covered in more detail in lesson five.

Insert Timeline will add a timeline to your PivotChart. A timeline is used to filter dates
interactively. Timelines make it easier to select time periods to filter the PivotChart.

Filter Connections allows you to manage the filters that are applied to the PivotChart. It
makes it faster and easier to filter the data in a PivotChart.

Figure 3-39 PivotChart Filter

Data
Data is refreshed using this option. Exercise 2-6 walked you through how to refresh data.
Change Data Source will allow you to view the existing connection properties or to change
the data source.

Figure 3-40 PivotChart Data

Actions
Clear will delete the entire PivotChart or the Filters.
Move Chart is used to move the PivotChart within the workbook. It can be moved elsewhere
on the existing worksheet or to another worksheet within the workbook.

Figure 3-41 PivotChart Actions

Copyright ©2017 Pathfinder Learning, LLP

72 Excel PowerPivot 2016
Calculations
The options available in this group are Fields, Items & Sets, OLAP Tools and Relationships.

Figure 3-42 PivotChart Calculations

Fields, Items & Sets
This provides the option to view existing measures and items. Measures are covered
in lesson four. The difference between a measure and a calculated item is that in
measures there are distinct columns that you are doing something to. In calculated
items you are actually working within the field and adding, subtracting or completing
some sort of calculation to the items in the field.
Solve Order allows you to change the order in which calculations will be done.
Sets of data can be created or maintained under this option. Sets allow you to take a
sub-set of the data and name that sub-set to appear on a report.
OLAP Tools
The OLAP tools option allows you to work with a PivotTable connected to an OLAP
(Online Analytical Processing) data source.
Relationships
Clicking on relationships will display the current relationships defined in your data
model. Once displayed, you can create new relationships, edit existing relationships,
delete relationships and even activate/deactivate a relationship.

Figure 3-43 PivotChart Relationships
Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 73

Show/Hide

These options will allow you to turn on and off various sections on the PivotChart workspace.

 Field List will display the available fields that can be added or changed for the
current PivotChart.

 Field Buttons will add and remove buttons for report filter fields, axis fields, legend
fields and value fields.

Figure 3-44 PivotChart Show/Hide

Copyright ©2017 Pathfinder Learning, LLP

74 Excel PowerPivot 2016
Exercise 3-5 Use the Analyze Tab to Change your PivotChart
Now that you have reviewed the many options available on the analyze tab, you can use some of them to
improve your PivotChart that was created in exercise 3-4. For this exercise you will be changing the name of
the PivotChart and exploring the Show group to see the effect each button has on your PivotChart workspace.
1. Launch Excel®.
2. Click Blank workbook.
3. Click File > Open
4. Locate the file in the Class Files\Lesson3 folder. Click Exercise 3-5. Click Open.
5. Click anywhere on the PivotChart. Notice the PivotChart Tools option appears on the Excel® ribbon.
6. Click Analyze.
7. In the PivotChart group, click in the box that contains the text Chart 1. Replace this text with the

following text: Sales by year and brand. Click anywhere else on the chart and you can see that the
PivotChart name has been changed.
8. Click Field List. Notice the PivotChart Field List disappears. Click Field List again and it returns.
9. Click Field Buttons. A list of buttons that can be turned off will display. Remove each one and notice the
change that takes place on your chart. Click Field Buttons again and click Hide All and they will all be
added back again.

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 75

Design

The next tab available on PivotChart Tools is Design. None of the changes made on the design tab
will change how your data is stored, it will only change the display of the data in the chart. Design
contains items to update the layout of your chart such as color enhancements. These are called Chart
Styles. Below is a brief description of each group on this tab.

Figure 3-45 PivotChart Design

Chart Layouts
Chart Layouts contain options that can change the way the PivotChart is displayed.

 Add Chart Element allows the addition of a new axis, axis and chart titles, gridlines,
data labels and legends.

 When clicking on the Quick Layout option, various styles of charts can be previewed
instantly.

Figure 3-46 PivotChart Layouts

Chart Styles

Change Colors allows you to choose groups of colors to apply to your chart. These are pre-
defined combinations that can quickly change the display of your chart.

Chart Styles are images that are displayed that give you a preview of the way your chart can
look. You can hover over an image and your chart will switch to that display temporarily.
This allows you to preview the change before actually applying it to your chart. If you don’t
like the look, choose another one. It does not change any of the data that is displayed – only
the formatting.

Figure 3-47 PivotChart Styles

Copyright ©2017 Pathfinder Learning, LLP

76 Excel PowerPivot 2016
Data
Switch Row/Column causes the data that is on the Y axis to be moved to the X axis and the X
axis moved to the Y axis.
Select Data opens another window where you can change the data to be included in the chart.

Figure 3-48 PivotChart Data

Type
Change Chart Type provides the ability to change from a bar chart to a pie chart. There are
many chart types available.

Figure 3-49 PivotChart Change Type

Location
Move Chart allows you to move your chart to another location on the same worksheet or
anywhere in the workbook.

Figure 3-50 PivotChart Location

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 77
Exercise 3-6 Use the Design Tab to Change your PivotChart
Now that you have reviewed the many options available on the Design tab, you can use some of them to
change your PivotChart that was updated in exercise 3-5. For this exercise you will be using various options
from the design tab to change the look of your Chart
1. Launch Excel®.
2. Click Blank workbook.
3. Click File > Open
4. Locate the file in the Class Files\Lesson3 folder. Click Exercise 3-6. Click Open.
5. Click anywhere on the PivotChart. Notice the PivotChart Tools option appears on the Excel® ribbon.
6. Click Design.
7. In the Chart Layouts group, click on the arrow under Quick Layout. Move your mouse over each of the

options and watch how your chart changes. Click on one of the options to make the change permanent.
8. In the Chart Styles group, scroll through the available styles or click the last button on the scroll bar to see

all the styles at once. Move your mouse over each option and notice how it is applied to your PivotChart.
Click to choose your favorite.
9. In the Type Group, click Change Chart Type. Review the various chart types available. Choose your
favorite. Click OK.

Copyright ©2017 Pathfinder Learning, LLP

78 Excel PowerPivot 2016
Format
Now let’s explore the Format tab, the final tab available on PivotChart tools. Below is a brief
description of each group on this tab.

Figure 3-51 PivotChart Format

Current Selection
The drop down selection allows the user to select the field that they would like to format.
Format Selection will cause a task pane to open on the right side of the screen. This pane will
look different based on the type of element that was chosen in the drop down. It may contain
options for colors, borders, fill options, etc. It allows fine tuning of the selected chart element.
Reset to Match Style will clear the custom formatting of the selected chart element back to
the overall visual style that had been applied to the chart.

Figure 3-52 PivotChart Current Selection

Insert Shapes
Insert Shapes will add a new shape anywhere on your workbook. This has many shapes to
choose from. Use the down arrow with the line above it to see all your choices in one place.
Change Shape will allow you to change the existing shape to another shape while preserving
the existing formatting.

Figure 3-53 PivotChart Insert Shapes

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 79

Shape Styles

The first selection box displaying the three squares are only the first of many available
formatting styles that can be applied to the selected portion of your chart. Using the down
arrow with the line above it, will allow you to see all your choices in one place. These are
quick formatting options that you can choose.

If you cannot find exactly what you want, you can customize the chart by using the three
other items in this group.

 Shape Fill allows you to change colors, shading and texture of the background of the
chart. You can even add a photo.

 Shape Outline changes the color and thickness of the outline around your chart.

 Shape Effects adds shading to the chart. The small arrow in the corner, will cause
another pane to display on the right side of the screen. If you have selected the chart,
this new pane will allow you to format the gridlines. If you have selected the area
where the bars are displayed, it will allow you to change the plot area.

Figure 3-54 PivotChart Shape Styles

WordArt Styles

The first box displaying the three types of fonts are available formatting styles for text, that
can be applied to the selected portion of your chart. Using the down arrow with the line above
it will allow you to see all your choices in one place. These are quick formatting options that
you can choose.

If you cannot find exactly what you want, you can customize your chart by using the three
other items in this group.

 The first option is Text Fill, which allows you to fill the text with a solid color,
gradient, picture or texture.

 The second option is Text Outline, which provides options to change the color, width
and line style.

 The last option is Text Effects, which allows you to add special effects like shadow,
glow or reflection to your text.

 The small arrow in the corner will cause another pane to display on the right side of
the screen. If you have selected the legend, the Format Legend pane will display. If
you have selected the data labels on the axis, the Format Axis pane will display. Both

Copyright ©2017 Pathfinder Learning, LLP

80 Excel PowerPivot 2016
allow formatting of the text, presenting options such as shadow, reflection, glow, soft
edges, 3-D format and 3-D rotation.

Figure 3-55 PivotChart WordArt Styles

Arrange
Bring Forward will move the object forward one level or move the object all the way to the
front of the objects.
Send Backward will move the object one level backward or move the object all the way to the
back of the objects.
Selection Pane will open a pane so that you can view the objects that are defined on your
worksheet. This makes it easier to select objects, change their order or change their visibility.
Align will allow you to line up your objects to each other or to the margins.
Group will allow you to treat multiple objects as one object. By grouping the objects, you can
assign formatting to the entire group instead of one object at a time.
Rotate will allow you to turn the object on the page.

Figure 3-56 PivotChart Design

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 81

Size

Size allows you to enter numbers or use the arrows to change the size of the object. The small
arrow in the corner will cause another pane to display on the right side of the screen. This
allows for more options for changing the size and properties of your objects. If you have
selected the axis, the format axis pane will display. There are many options available to
change the way the axis is formatted. Similarly the legend, gridlines and data can be
customized from this pane.

Figure 3-57 PivotChart Size

Copyright ©2017 Pathfinder Learning, LLP

82 Excel PowerPivot 2016
Exercise 3-7 Use the Format Tab to Change your PivotChart
Now that you have reviewed the options available on the Format tab, you can use some of them to change
your PivotChart that was updated in exercise 3-6.
1. Launch Excel®.
2. Click Blank workbook.
3. Click File > Open
4. Locate the file in the Class Files\Lesson3 folder. Click Exercise 3-7. Click Open.
5. Click anywhere on the PivotChart. Notice the PivotChart Tools option appears on the Excel® ribbon.
6. Click Format.
7. In the Shape Styles group, click Shape Fill. Move you mouse over each color and notice how your chart

changes. Click on your favorite to make the change permanent.
8. In the Shape Styles group, click Shape Effects. Try each of the options and see the effect they have on

your chart. Click on your favorite to make the change permanent.
9. In the WordArt Styles group, click the arrow with the line above it. Move the mouse over each font style

and notices how your chart changes. Click on your favorite to make the change permanent.

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 83

Lesson 4: Use DAX in PowerPivot

Unit time: 75 minutes
In this lesson, you will:
1 Review DAX
2 Context in DAX Formulas
3 Define Calculated Columns
4 Define Measures

Copyright ©2017 Pathfinder Learning, LLP

84 Excel PowerPivot 2016

Review DAX

Data Analysis eXpressions language or DAX is used to create formulas in PowerPivot. DAX is very similar
to Excel® formulas. Most of the functions in DAX are named the same and share the same behavior as
Excel®. Functions are pre-written formulas that make it easier to do complex calculations and manipulations
with numbers, dates, time, text and more. The main difference is that Excel® is focused on cell calculations
while DAX is focused on tables and columns based on the PowerPivot data model.

The formula must begin with an equal sign and is followed by an expression or function. The table name is
not required. If it is omitted, the current table will be scanned for the field name. It is suggested to use the full
table name and field name combination so that there is no confusion. Column names are enclosed in brackets
[ ].

When you are adding formulas or functions, you will be working in the formula bar. You begin by typing an
equal sign =, then type an opening bracket [. You’ll see a small window appear with all of the columns in the
table. This is IntelliSense in action. IntelliSense displays the available tables, columns and functions based on
what you have typed. To select a field, double-click on the field name. When you have finished the formula,
press Enter. Once enter is pressed, the formula is validated.

PowerPivot handles data types automatically based on the data types in the expression. A data type is the
classification of the data that can be placed in the field. Examples include date, string and number. If one of
the types is a date, then the result will be a date. PowerPivot automatically converts numbers to strings or
strings to numbers as needed. The formula = 5 & 4 will return a string of 54 while = “5” + “4” returns an
integer of 9.

DAX Operators

DAX supports the operators below. Most of these operators work the same as in Excel®.

Operator Type Syntax Use Example
Determine order and (1 + 3) * 5
Parenthesis () grouping of calculations
2+5
Arithmetic + Addition 5–2
Comparison - Subtraction 3*5
* Multiplication 4/2
Concatenation / Division [State] = “IL”
Logical [State] <> “IL”
= Equal [Amount] > 0
Table 4-1 DAX Operators <> Not equal [Amount] >= 0
> Greater than [Amount] < 0
>= Greater than or equal to [Amount] <= 0
< Less than “Value is “ & [Amount]
<= Less than or equal to [State] = “IL” && [Age] > 0
AND ([State] = “IL”, [Age] > 0)
& Concatenate strings [State] = “IL” || [Age] > 0
OR ([State] = “IL”, [Age] > 0)
&& AND condition between ! ([State] = “IL”)
AND two Boolean expressions NOT ([State] = “IL”)
|| OR condition between two
OR Boolean expressions
! NOT condition between
NOT two Boolean expressions

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 85

Functions

DAX contains many functions that are grouped into categories. Like the operators, DAX supports
many of the Excel® functions. Functions are predefined formulas that perform calculations by using

specific values, called arguments, in a particular order or structure. Arguments can be other functions,
another formula, column references, numbers, text, logical values such as TRUE or FALSE, or
constants. In the next few sections, each of the categories are explained. In addition, some of the more
common functions are detailed. For more detailed information on all DAX functions refer to this link
http://technet.microsoft.com/en-us/ff452127.aspx.

Text Functions

Functions in this category are used to manipulate text (string) data. The majority of these functions
are the same as functions in Excel®. See Table 4-2 for some commonly used text functions.

Function Description
CONCATENATE(<text1>, <text2>) Combines the values in two fields into one field. If you
need to combine more than two fields, use the operator
EXACT(<text1>, <text2>) (&) instead.

FIND(<find_text>, <within_text>, Compares the values in two fields and returns true if
[,<start_num>]) they are identical and false if they are not identical.

LEFT(<text>, <num_chars>) Searches for the first place that the value is found in the
field. The <start_num> argument specifies where in the
MID(<text>,<start_num> field to start the search. It is case sensitive.
[,<num_chars>]
Retrieves the specified number of characters from the
Table 4-2 Text Functions beginning of the string.

Retrieves characters from the middle of the field starting
from the <start_num> position.

Date and Time Functions

Functions in this category are used to manipulate date and time fields. DAX date and time functions
are similar to Excel® date and time functions. Some of the more common date and time functions are
explained in Table 4-3.

Function Description
DAY(<date>) Returns the day number portion of the date.
MONTH(<datetime>)
NOW() Returns the month portion of the date.
TODAY()
Returns the current date and time.
YEAR(<date>) Returns the current date. The hour, minute and seconds
are set to zero.
Table 4-3 Date and Time Functions Returns the four digit year from the date field.

Copyright ©2017 Pathfinder Learning, LLP

86 Excel PowerPivot 2016
Logical Functions

Most of the functions in this category check the value in a field to determine if it meets the logical test
condition. This test returns a value of TRUE or FALSE. Some of the more common logical functions
are explained in Table 4-4.

Function Description
AND(<logical1>, <logical2>)
Returns TRUE if both parts evaluate to true. Returns
IF(<logical_test>, <value_if_true>, FALSE if either part evaluates to false. If you need to
<value_if_false>) combine more than two fields, use the operator (&&)
instead.
IFERROR(<value>,
<value_if_error>) This function evaluates the logic test. If the test is true,
NOT(<logical>) the true portion of the expression is executed. If the test
OR(<logical1>, <logical2>) is not true, the false portion of the expression is
executed.
Table 4-4 Logical Functions
Returns the specified value if the expression returns an
error, otherwise the value from the expression is
returned.

Returns TRUE if the logical is false. Returns FALSE if
the result is true.

Returns TRUE if either logical evaluates to true. Returns
FALSE if both logicals evaluate to true. If you need to
combine more than two fields, use the operator (||)
instead.

Statistical/Aggregation Functions

These functions have the same name in PowerPivot and Excel® but the DAX versions work with
columns and tables instead of individual cells and ranges of cells. Aggregate functions take values in
a column as input and provide a single value as output. DAX provides many functions for creating
aggregations such as sums, counts, and averages. These functions are very similar to aggregation
functions used by Excel®. Some of the more common statistical functions are explained in Table 4-5.

Function Description
AVERAGE(<column>) Returns an average of all numbers in a column. Non
numeric values and text are ignored.
COUNT(<column>)
MIN(<column>) Counts the cells in a column that contain numbers.
MAX(<column>) Returns the minimum value of a column.
SUM(<column>)
Returns the maximum value of a column.
Table 4-5 Statistical Functions Returns the sum of the values of a column.

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 87

Informational Functions

These functions are often used as the first part of an IF function because they return a TRUE or
FALSE value. They are used to check if a field is blank, contains text or contains a number. Some of
the more common informational functions are explained in Table 4-6.

Function Description
ISBLANK(<value>) Returns TRUE if the <value> is blank.
ISERROR(<value>)
ISNONTEXT(<value>) Returns TRUE if the <value> is any error value.
Returns TRUE if the <value> is not text. A blank value
ISNUMBER(<value>) is not considered text and returns TRUE.
Returns TRUE if the <value> is a number. A blank
ISTEXT(<value>) value is not considered a number and returns FALSE.
Returns TRUE if the <value> is text. A blank value is
Table 4-6 Informational Functions not considered text and returns FALSE.

Math and Trigonometric Functions

The functions in this category are the same as the ones in Excel®. Some of the more common math
functions are explained in Table 4-7.

Function Description
ABS(<number>) Returns the absolute value of a number.
MOD(<number>, <divisor>) Returns the remainder of a division calculation.
POWER(<number>, <power>) Returns the number raised to the power.
ROUND(<number>, <num_digits>) Rounds the number to a specific number of digits.

Table 4-7 Math and Trigonometric Functions

Filter Functions

The functions in this category do not exist in Excel®. These functions are used to create dynamic
calculations and manipulate the data context. Context is explained later in this lesson. A filter
expression is created to query the data in the table to only retrieve the records that meet the criteria
specified in the filter. Filters are applied dynamically when the data is refreshed, updated or
recalculated. Some of the more common filter functions are explained in Table 4-8.

Function Description
ALL(<table_or_column>) Ignores any filters that may have been applied and
returns all of the values in a column or all of the rows in
DISTINCT(<column>) a table. Use this function when you need to clear filters.
FILTER(<table>, <filter>) Returns a one column table that has unique values from
the specified column.
RELATED(<column>) This function tells another function what data to use. It
passes a table to another function that performs the
Table 4-8 Filter Functions calculation.
This function is used to retrieve a matching value for a
code in a table. Use this function when the value being
retrieved is from a column.

Copyright ©2017 Pathfinder Learning, LLP

88 Excel PowerPivot 2016

Time Intelligence Functions

When analyzing your data you are going to come across date information. DAX functions facilitate
analysis through the use of time intelligence functions that allow you to manipulate data over time
periods such as days, months, quarters and years. The functions in this category are new, they do not
exist in Excel®. They allow you to compare today’s sales to sales one year ago, calculate the sales for
the last 30 days, calculate sales for the last quarter and more. Table 4-9 contains some more common
time intelligence functions.

Function Description
PREVIOUSMONTH(<date_column>) Returns a table of all dates for the month before the first
date in the dates column.
PREVIOUSQUARTER
(<date_column>) Returns a table of all dates for the quarter before the
PREVIOUSYEAR (<date_column>) first date in the dates column.
[,year_end_date])
TOTALMTD(<expression>, <dates>, Returns a table of all dates for the year before the first
[,<filter>]) date in the dates column.
TOTALQTD(<expression>, <dates>,
[,<filter>]) Evaluates the expression for the month to date of the
TOTALYTD(<expression>, <dates>, month specified.
[,<filter>] [,year_end_date]))
Evaluates the expression for the quarter to date of the
Table 4-9 Time intelligence Functions quarter specified.

Evaluates the expression for the year to date of the year
specified.

To work with time intelligence using DAX, you need to have a calendar table inside the data model.
This table will contain a row for each date, using the date as a key to link that calendar table with
other tables that contain data related to a date. Figure 4-1 is a sample date table. The data model we
have been working with for all of the exercises also has a date table. It is called DimDate. An
important thing to remember is that the date column that you use when calling a function is the date
column of the calendar table and not the date column of the table that is being analyzed.

Figure 4-1 Sample date table
Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 89

Context in DAX Formulas

Formulas in PowerPivot can be affected by relationships between tables, by the filters applied in a PivotTable
and by filters used in formulas. Context is what makes it possible to perform dynamic analysis. There are
different types of context: row context, query context and filter context.

Row context is the current row. Row context automatically follows the relationships between tables to
determine which rows in related tables are associated with the current row.

Query context is the subset of data that is created for each cell in a PivotTable, depending on the row and
column headers. When you drop a field into a cell in a PivotTable, the PowerPivot engine examines the row
and column headers, slicers, and report filters to determine the context. PowerPivot makes the necessary
calculations to populate each cell in the PivotTable. The set of data that is retrieved is the query context for
each cell.

Filter context is the set of values allowed in each column based on the filter chosen. Filter context is added
when you specify filter constraints on the set of values allowed in a column or table, by using arguments to a
formula. Filter context applies on top of other contexts, such as row context or query context.

Define Calculated Columns

A calculated column is added to an existing PowerPivot table and is based on data in that table. A formula is
written using DAX, which is automatically applied to each row in the table. You cannot create a different
formula for different rows in a PowerPivot table. The formulas are very similar to Excel® formulas.

To add a new calculated column, switch to the Data View of the data model. Each table has a column on the
far right labeled Add Column. Once you click in this column, the bar above the table names turns into a
function bar. You can type in the DAX formula or use the auto-complete feature to choose the functions and
fields that you need for your formula. See figure 4-2.

Figure 4-2 Calculated Column

Copyright ©2017 Pathfinder Learning, LLP

90 Excel PowerPivot 2016
Exercise 4-1 Create a Calculated Column with Data in the Same Table
For this exercise, you will use the PivotTable that was previously created using Contoso Sales data. A new
calculated column will be created that will contain the profit on sales.
1. Launch Excel®.
2. Click Blank workbook.
3. Click File > Open
4. Locate the file in the Class Files\Lesson4 folder. Click Exercise 4-1. Click Open.
5. Click Power Pivot.
6. Click Manage Data Model.
7. Click on the tab labeled FactSales. It is located at the bottom of the screen.
8. Scroll to the right and click in the column labeled Add Column. You should notice that there is now a line

with fx so that you can add your new formula.

9. Type =[ and you will see a list of fields that are available in this table. Choose SalesAmount by double-
clicking on the name. PowerPivot will place the field in the formula bar. Follow the field name with –[
then double-click on the field TotalCost. The last portion of the formula is –[ and the field
ReturnAmount.

10. When the formula is complete, press Enter. The formula will be applied to each row and you will see the
value in a column named CalculatedColumn1. Scroll down in the table and you should see different
values for different rows.

11. Rename the default of CalculatedColumn1 by right-clicking the column and select Rename Column.
Type Profit and press Enter.

12. Save. You will continue to use this file for the next exercise.

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 91
Exercise 4-2 Create Calculated Columns with Data from Different Tables
For this exercise, you will continue with the PivotTable that was updated in exercise 4-1. Two new calculated
columns will be created to bring values into the DimProduct table from other tables in the data model.
1. Click Power Pivot.
2. Click Manage Data Model.
3. Click on the tab labeled DimProduct. It is located at the bottom of the screen.
4. Scroll to the right and click in the column labeled Add Column. You should notice that there is now a

line with fx so that you can add your new formula.

5. Type the following formula = RELATED(ProductCategory[ProductCategoryName]). As you start
typing RELATED, notice that a list of functions will display. You can continue to type or double-click on
RELATED. Start typing ProductCategory and again you will be displayed with options. Double-click on
ProductCategory[ProductCategoryName]. Don’t forget the closing parenthesis ).

Copyright ©2017 Pathfinder Learning, LLP

92 Excel PowerPivot 2016
6. When the formula is complete, press Enter. The formula will be applied to each row and you will see the

value in a column named Calculated Column 1. Scroll down in the table and you should see different
values for different rows.

7. Rename the default name of Calculated Column 1 by right-clicking the column and select Rename
Column. Type ProductCategory and press Enter.

8. Follow the same steps as above to create another Calculated Column that contains the following formula
=RELATED(DimProductSubcategory[ProductSubcategoryName]).

9. Rename the default of Calculated Column 1 by right-clicking the column and select Rename Column.
Type ProductSubcategory and press Enter.

10. Save. You will continue to use this file for the next exercise.

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 93

Define Measures (Calculated fields)

Calculated fields, known as Measures in PowerPivot 2016, are calculations used in data analysis. Some
examples include: sum, average, counts or more complex calculations that you can create using DAX. A
measure uses the context of the rows and columns to determine its value. The value always changes in
response to the selection of filters. This allows for data exploration. Measures can be either implicit or
explicit. This affects how you use them in a PivotTable or PivotChart.

Implicit Measure
Implicit measures are created whenever you drag a field to the Values area of the PivotTable Fields
list. Implicit measures can only use a standard aggregation (SUM, COUNT, MIN, MAX,
DISTINCTCOUNT, AVG), and must use the data format defined for that aggregation. In addition,
implicit measures can only be used by the PivotTable or PivotChart where they were created.
Explicit Measure
Explicit measures are created whenever you enter or select a formula in a cell in the Calculation Area.
Explicit measures can be used by any PivotTable or PivotChart in the Excel® workbook. In addition,
explicit measures can become a KPI.

There are two ways to create measures. The first option is to use the AutoSum button that is available on the
Manage Data Model window. See figure 4-4. To use the button, click on the column that you want to use for
the measure. Once the column is selected, click AutoSum. A new field will be added to the bottom of the
column. Figure 4-5 is an example of how the measure displays in the data view.

Figure 4-4 Calculations

Figure 4-5 Measure

Copyright ©2017 Pathfinder Learning, LLP

94 Excel PowerPivot 2016
Another way to add a measure is to click on the Measures button on the Power Pivot ribbon. Clicking on this
button displays two options: New Measure and Manage Measures. Clicking New Measure will display a new
window that will allow you to define the field. See figure 4-6.

Figure 4-6 Add Measure

Manage Measures will display another window that contains all measures that have been defined in the
current workbook. The fields can be edited or deleted via this window. See figure 4-7.

Figure 4-7 Manage Measures
Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 95

Exercise 4-3 Create Measures

For this exercise, we will continue with the PivotTable that was updated in exercise 4-2. You will create three
different measures. The fields that will be added are the sum of profit, number of sales for a particular product
or category and the percentage of total sales. All three of these fields will make it easy to analyze the data
based on the filters or context applied. The first two fields are being added by using AutoSum. The last field
will be added by typing in the formula.

Sum of Profit

1. Click Power Pivot.

2. Click Manage Data Model.

3. Click on the tab labeled FactSales.

4. Click on the column heading Profit.

5. In the calculations group, click AutoSum. Notice a new measure named Sum of Profit was automatically
created in the cell directly below the Profit column.

6. Return to your PivotTable in Excel®.
7. In PivotTable fields, scroll to the table FactSales. Click the arrow to expand the table to see the fields.
8. Click Sum of Profit. The new field was added to the FactSales table.
9. Notice the new data that is now displayed in your PivotTable.

Copyright ©2017 Pathfinder Learning, LLP

96 Excel PowerPivot 2016
Number of sales for a particular product or category
10. Return back to the Manage Data Model window and locate the FactSales table. Remember the tables are

represented as tabs in this window.
11. Click on the column heading SalesKey.
12. In the calculations group, click the down arrow next to AutoSum. Click Count. Notice a new measure

named Count of SalesKey was automatically created in the cell directly below the SalesKey column.
13. Return to your PivotTable in Excel®.
14. In PivotTable fields, scroll to FactSales.
15. Click Count of SalesKey. Notice the new data that is now displayed in your PivotTable.
Percentage of total sales
16. In the Excel® window, in the Calculations group, click Measures.
17. Click New Measure. A new window will display to allow you to define the new measure.

18. In Table name, choose FactSales.
19. In Measure name, enter Percentage of All Products.

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 97
20. In the formula area after the equal sign, key in this formula to calculate the percentage.

[Count of SalesKey]/CALCULATE([Count of SalesKey],ALL(DimProduct))
21. Click Check Formula. Verify you receive no errors in the formula.
22. Change the category from General to Number.
23. In Format, choose Percentage.
24. Click OK.
25. In PivotTable fields, scroll to FactSales.
26. Click Percentage of all Products. Notice the new data that is now displayed in your PivotTable.
27. Save.

Copyright ©2017 Pathfinder Learning, LLP

98 Excel PowerPivot 2016

Lesson 5: Enhance PivotTables & PivotCharts

Unit time: 75 minutes
In this lesson, you will:
1 Define Key Performance Indicators (KPIs)
2 Define Slicers
3 Define Hierarchies

Copyright ©2017 Pathfinder Learning, LLP

Excel® PowerPivot 2016 99

Define Key Performance Indicators (KPIs)

KPIs are graphical, visual measures of performance. A KPI is designed to help users quickly evaluate the
current value and status of a metric against a defined target. In business terminology, a KPI is a 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. Both are examples of a KPI.

KPIs use a base measure and evaluates it against a target value. The target value can be another measure or a
static value. In addition, a status threshold is defined as a range between a low and high threshold. The status
threshold displays with a graphic to help users easily determine the status of the base value compared to the
target value.

To add a new KPI, the measure must be created first. The KPI button is located on the Power Pivot ribbon, in
the calculations group. This button will allow you to add a new KPI or to manage the existing KPIs that have
been defined. You can also delete KPIs. Deleting a KPI will not delete the measures, only the KPI.

Adding a new KPI will cause the Key Performance Indicator (KPI) dialog box to display as shown in Figure
5-1. The measures that are available to use as the base field are displayed at the top as a drop down. The target
value is defined in the next section. Again you can use a drop down to choose the measure or enter an
absolute value. Next you will define the status thresholds. This will determine the colors that are displayed on
your KPI so that you can tell the status at a glance. And finally, you choose the icon style you want to display.
If you want to add descriptions to each of the fields, you can click descriptions at the bottom of the screen.

Figure 5-1 New KPI

Copyright ©2017 Pathfinder Learning, LLP

100 Excel PowerPivot 2016
Exercise 5-1 Create a KPI and Use it in a PivotTable
For this exercise, we will continue with the PivotTable that was updated in exercise 4-3. The sales department
wants a KPI using the number of sales. For this exercise we will use the brand name and the Product
Subcategory.
1. Click Power Pivot.
2. In the Calculations group, click KPIs > New KPI. The Key Performance Indicator (KPI) dialog box will

display.
3. In KPI base field (value), choose Count of SalesKey.
4. In Define target value, choose Absolute Value. Replace 100 with 100000. Press Tab and notice that the

status threshold values will automatically update.
5. In Select icon style, click your favorite.
6. Click OK. The dialog box will close and the new KPI is added to the bottom of the PivotTable Fields. It

appears as a stop light and is labeled Count of SalesKey.
7. In order to use the new KPI that you created, you need to add it to a PivotTable. You will create a new

one. Click Manage Data Model.
8. Click PivotTable. When the new dialog box appears, click OK. A new worksheet has been added.
9. In PivotTable Fields, expand the DimProduct table by clicking the arrow. Click and drag the BrandName

field to the Rows drop zone.
10. In the same table, click and drag the ProductSubcategory field to the Rows drop zone below the

BrandName field.
11. Expand the FactSales table. Locate the KPI you created. It is named Count of SalesKey. Click on the

arrow to expand the KPI.
12. Click Value. Notice the CountofSalesKey is added to your PivotTable and to the values drop zone.
13. Click Status. The icon style that you chose in step five will display next to the values. This allows you to

know at a glance if your number of sales are meeting the goal that you had set.

Copyright ©2017 Pathfinder Learning, LLP


Click to View FlipBook Version