Courses Learn Blog Contact
Get Started →
Lesson 19

Week 4, Virtual 2: PivotTable Practice

Two PivotTables from scratch on TechPlug, by Branch and by time, with a Customer_Type slicer.

Webbo3 Data Analytics Cohort 2: Excel Track 7 min read Free

Webbo3 Data Analytics · Cohort 2 · Excel Track · Week 4, Virtual 2

PivotTable Practice

Two PivotTables from a blank sheet, on your own: one by branch, one by time. Then one slicer that filters both at once.

By the end of this class you can

  • Build a PivotTable from scratch without help
  • Show revenue and number of sales side by side
  • Group dates into months, and into weeks when months are too few
  • Chart a trend with a line
  • Connect one slicer to two PivotTables

In Live 2 you followed along. Today, start from your Sales Data tab and a blank mind. If you get stuck, the click paths are here, but try each step before you read it.

What you do in this class

  1. PivotTable 1: revenue and number of sales by Branch, sorted.
  2. PivotTable 2: revenue by month, then by week, with a line chart.
  3. A Customer_Type slicer connected to both.
  4. Then read the Week 4 pod task: the Verdant Foods dashboard.

Hand in: A sheet called Pivots with both PivotTables, the line chart and the slicer.

PivotTable 1: By Branch

Revenue and sales by branch

1.Click any cell in the data › Insert › PivotTable › New Worksheet › OK › Rename the sheet Pivots
2.Branch to Rows › Revenue to Values (change Count to Sum) › Transaction_ID to Values
3.Right-click a revenue number › Sort › Sort Largest to Smallest
What this PivotTable showsWe want each branch's revenue and number of sales, sorted from the highest revenue.
XTechPlug_Sales_Workbook.xlsx - Excel
PivotTable
Row Labels ▾Sum of RevenueCount of Transaction_ID
Port Harcourt148,290,000122
Kano121,992,000123
Lagos Mainland115,079,000118
Ibadan109,342,000100
Warri100,485,00097
Enugu98,414,000112
Kaduna96,648,00094
Jos94,762,000105
Lagos Island92,071,00087
Abuja90,260,00092
Grand Total1,067,343,0001050
PivotTable Fields: drag fields between areas below
Rows
Branch
Values
Sum of Revenue
Count of Transaction_ID

Transaction_ID is text, so Excel counts it automatically: Count of Transaction_ID is the number of sales. The Grand Totals must be the company figures, 1,067,343,000 and 1,050.

Try This

Which branch has the highest revenue per sale? Divide each branch's revenue by its sales in a column next to the PivotTable.

Check your answer

Port Harcourt. Compare it with the branch that made the most sales, Kano: a different branch. Revenue and number of sales tell different stories, which is why it helps to see both.

PivotTable 2: By Time

Put a second PivotTable on the same Pivots sheet, a few columns to the right of the first.

Revenue over time

1.Go back to the data, click any cell › Insert › PivotTable › Existing Worksheet › Location: Pivots!$F$3 › OK
2.Date to Rows › Revenue to Values (Sum)

When you drop a date field in Rows, Microsoft 365 groups it for you: it adds Months (and sometimes Years and Quarters) to the Rows box and shows Jan, Feb, Mar. If yours lists every single date instead, group it yourself:

If the dates are not grouped

1.Right-click any date in the PivotTable › Group › Select Months only › OK
What this PivotTable showsWe want TechPlug's revenue for each month in the workbook, in calendar order.
XTechPlug_Sales_Workbook.xlsx - Excel
PivotTable
Row Labels ▾Sum of Revenue
Jan368,006,000
Feb337,417,000
Mar361,920,000
Grand Total1,067,343,000
PivotTable Fields: drag fields between areas below
Rows
Months
Values
Sum of Revenue

Three rows. You already know the story they tell from Week 1: February is lowest because it is shortest. Three points make a poor trend line, though: a line through three dots says almost nothing. When the months are too few, group by week instead.

Grouping by Week

Seven-day groups

1.Right-click any month in the PivotTable › Ungroup
2.Right-click any date › Group › Untick Months › Tick Days › Number of days: 7 › Starting at: 2024-01-01 › OK
What this PivotTable showsWe want revenue for each week of the quarter, in time order.
XTechPlug_Sales_Workbook.xlsx - Excel
PivotTable
Row Labels ▾Sum of Revenue
1 Jan89,021,000
8 Jan86,715,000
15 Jan79,416,000
22 Jan75,430,000
29 Jan96,977,000
5 Feb78,111,000
12 Feb76,057,000
19 Feb57,072,000
26 Feb93,369,000
4 Mar88,088,000
11 Mar86,647,000
18 Mar76,305,000
25 Mar84,135,000
Grand Total1,067,343,000
PivotTable Fields: drag fields between areas below
Rows
Date
Values
Sum of Revenue
Excel labels each group with its first and last date. The last group, from 25 March, is 7 days, because the quarter ends there.

Do not sort this one by value. Time has a natural order, and a trend only makes sense in that order.

A line for a trend

1.Click inside the week PivotTable › PivotTable Analyze › PivotChart › Line › Line › OK
2.Change the title to the finding › Delete the legend
What this chart showsWe want the weekly revenue as a line, so the rise and fall through the quarter is visible, with the best week marked.
XTechPlug_Sales_Workbook.xlsx - Excel
PivotChart

The best week was 29 January to 4 February, at 96,977,000. The lowest full week was 19 February to 25 February, at 57,072,000. The rest move up and down around them with no steady climb or fall: a business holding level through its first quarter. Use a line for things that change over time and bars for comparing separate groups: that choice is part of your pod's dashboard brief too.

One Slicer, Two PivotTables

A slicer for both tables

1.Click inside the branch PivotTable › PivotTable Analyze › Insert Slicer › Customer_Type › OK
2.Click the slicer › Slicer (tab) › Report Connections › Tick both PivotTables › OK
3.Click Wholesale in the slicer

To see it on a short table, regroup the time PivotTable by Months for a moment:

What this PivotTable showsWe want the month PivotTable after Wholesale is clicked in the slicer: wholesale revenue only, month by month.
XTechPlug_Sales_Workbook.xlsx - Excel
PivotTable
Customer_TypeWholesale ▾
Row Labels ▾Sum of Revenue
Jan139,305,000
Feb98,908,000
Mar136,637,000
Grand Total374,850,000
PivotTable Fields: drag fields between areas below
Rows
Months
Values
Sum of Revenue
The slicer shows Wholesale selected; both PivotTables and the chart now show wholesale only.

Wholesale brought in 374,850,000 over the three months, 35% of everything. Click Retail, then Corporate, and compare: the same two tables answer three questions in three clicks.

Report Connections Is the Step People Forget

A new slicer only controls the PivotTable you inserted it from. Report Connections is how one slicer drives every PivotTable built from the same data. Your pod dashboard needs this.

Picture This

Picture one light switch wired to every lamp in the room. Report Connections is the wiring.

Checkpoint

Q1. Why does Transaction_ID in Values show a count, not a sum?

It is text. Excel can only count it.

Q2. Your time PivotTable lists every single date. What do you do?

Right-click a date, Group, and choose Months, or Days with a number of days such as 7.

Q3. Why group TechPlug's sales by week rather than month for a line chart?

The workbook covers only three months; three points make a poor trend line. Thirteen weeks show the shape.

Q4. A slicer filters one PivotTable but not the other. Why?

It is not connected to the second one. Use Report Connections.

Tick Before You Move On

  • ☐ I built the branch PivotTable with revenue and number of sales, sorted
  • ☐ I grouped the dates by month, then by 7-day weeks
  • ☐ I added a line chart whose title states the finding
  • ☐ One Customer_Type slicer filters both PivotTables

Quick Recap

Text fields in Values are counted; number fields are summed. Dates in Rows group into months, or into weeks with Group, Days, 7; keep them in time order. Lines for trends over time, bars for comparing groups. Report Connections lets one slicer filter several PivotTables.

Next: Pod Task Week 4. Your pod builds the Verdant Foods dashboard: a KPI row, three charts, a slicer and three written insights.

Learn this with a real instructor

Free lessons take you a long way on your own. The full programmes add live classes, assignments, Skill Points and a certificate — built for African students.