Skip to Content
Using Secondary Rows
shortcut

Using Secondary Rows

by Dawn Griffiths
June 2024
Beginner
5 pages
2m
English
O'Reilly Media, Inc.
Content preview from Using Secondary Rows

Using Secondary Rows

Problem

You have a PivotTable and want to use two or more fields for its rows.

Solution

Suppose you have an empty PivotTable based on a table of sales data with columns named Category, Product, Month, and Amount. You want to calculate the total amount for each category, product, and month.

You can solve this problem using secondary rows. You add secondary rows by following these steps:

  1. Drag the Category field in the Fields section to the Rows section; then drag the Product field to the Rows section, placing it underneath the Category field. This adds secondary rows to the PivotTable so each Product value appears under the relevant Category.

  2. Drag the Month field to the Columns section and the Amount field to the Values section; this calculates the sum of the amount values for each category, product, and month.

Figure 1 shows the resulting PivotTable and its PivotTable Fields pane.

Screenshot of a PivotTable with secondary rows
Figure 1. Adding secondary rows to a PivotTable
Note

You can also add secondary rows by drilling down into the data. Double-click a row or column item in the PivotTable; then use the Show Detail dialog box to specify which data you want to display.

Discussion

Secondary rows let you slice, dice, and group your PivotTable data and include summary values for different combinations. You can also include secondary columns ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Moving a PivotTable

Moving a PivotTable

Dawn Griffiths
Filtering Data

Filtering Data

Dawn Griffiths

Publisher Resources

ISBN: 9781098170882