10.7 Group By
Turn detailed records into a summary you can explain
A delivery team has a list of individual orders. Its manager wants four useful numbers: the amount recorded for each city, the number of delivered orders, the largest order and the average order value. Reading every line repeatedly is slow. Group By lets you define the groups once and rebuild the same summary when the source changes.
The operation answers a question about the rows supplied to it. It does not decide which orders belong in the report, remove accidental repeats or fix missing amounts. Those choices need clear rules before the summary becomes trustworthy. A tidy four-row output can still be wrong if the seven input records were selected incorrectly.
All records and business figures on this page are fictional teaching data. FreshGo and MarketRush are invented platforms. Think of the kind of operational report a team might build for an app such as Swiggy or Amazon, without treating this fixture as real company performance. Keep every amount in the stated currency, INR, throughout the main labs.
1. Decide what a row means before choosing an operation
Grouping fields define the question
City is a grouping field when the question is about cities. City and Platform together define a more detailed question about each city's activity on each platform. Adding Status creates separate delivered, cancelled or returned groups. Adding Order ID may leave nearly every order in its own group, which does not produce the city summary the manager requested.
- Input grain: the business event represented by one source row.
- Grouping key: the field or combination of fields used to collect related rows.
- Aggregation: the calculation performed within each group, such as a sum or count.
- Output grain: the business meaning of one resulting summary row.
Use plain wording beside the workbook: “One row in CityDelivered represents one city's delivered orders for this report period.” This sentence is a practical test of your settings. If the output has several Pune rows, inspect the additional grouping fields before assuming that Power Query failed.
A row count is not automatically an order count
Count Rows counts the records that reach a group. It becomes a count of orders only when each included record represents one distinct order under the chosen identity rule. A source with one row per product line, one row per status update or repeated exports has a different meaning.
Suppose an order contains rice and milk and appears on two product lines. Counting those lines gives two, while the number of orders is one. A report can legitimately show both metrics, but their labels must explain the difference. We will build a separate small lab for this situation instead of hiding it behind a generic Orders heading.
Summaries do not preserve every analytical detail
After a normal Group By step, the output contains the selected grouping fields and calculated columns. Product, Date and Order ID may disappear because they are neither grouping fields nor requested results. The operation has changed the query's output shape; it has not deleted the source workbook.
However, do not promise that a separate detailed query automatically exists. If you grouped directly in the only query, its final output is now summarized. Keep a clearly named detail query and create a Reference for a summary when both outputs are needed. This also makes it easier to trace a surprising number back to the contributing records.
2. Lab 1: rebuild the original delivered-city summary
Enter the exact seven-order fixture
Create a workbook named GroupByPractice.xlsx and a sheet named DeliveredSource. Enter the following three-column table in A1:C8. These seven records have already been selected as Delivered. There is no Status column in this small fixture, so do not search for one or invent an additional filtering step inside this particular query.
| Order ID | City | Amount |
|---|---|---|
| BLK-1001 | Pune | 64 |
| BLK-1002 | Nashik | 270 |
| AMN-1003 | Pune | 110 |
| AMN-1005 | Kolhapur | 232 |
| BLK-1006 | Pune | 150 |
| BLK-1007 | Solapur | 1299 |
| BLK-1010 | Nashik | 90 |
- Select A1:C8, create an Excel Table and confirm that the first row contains headings.
- Name the Table
tblDeliveredGroupPractice. - On a separate Control sheet, record seven rows, seven unique Order IDs and total Amount 2,215.
- Confirm that Amount contains numeric values, not text with currency symbols embedded in each cell.
- Choose Data → From Table/Range to open the source in Power Query.
- Name the query
DeliveredDetail. Set Order ID and City to Text and Amount to an appropriate numeric type.
For this whole-rupee fixture, Whole Number can represent every supplied amount exactly. A real currency dataset may contain paise and require a different declared type, such as Fixed Decimal Number within its supported scale. Do not choose Whole Number merely to make fractional amounts disappear.
Create the summary as a Reference
- In the Queries pane, right-click DeliveredDetail and choose Reference.
- Name the new query
CityDelivered. - Choose Home or Transform → Group By and switch to Advanced.
- Keep City as the grouping field.
- Add Total Sales with operation Sum and column Amount.
- Add another aggregation named Orders with operation Count Rows.
- Confirm the dialog, then sort City ascending if you want the display order below.
The original lesson calls the result Total Sales. In this training fixture, that name means the sum of the recorded Amount values on delivered orders. It is not a separate claim about accounting revenue, taxes, refunds or fees. A production report needs an agreed definition before reusing a label such as Sales.
| City | Total Sales | Orders |
|---|---|---|
| Kolhapur | 232 | 1 |
| Nashik | 360 | 2 |
| Pune | 324 | 3 |
| Solapur | 1299 | 1 |
Reconcile the numbers in two directions
Pune contains 64, 110 and 150, giving 324 across three orders. Nashik contains 270 and 90, giving 360 across two orders. Kolhapur and Solapur each contribute one order. Add all city totals to recover 2,215, then add Orders to recover seven.
Load CityDelivered to a new worksheet Table named tblCityDelivered. The formula =ROWS(tblCityDelivered[City]) should return four city summary rows. The formula =SUM(tblCityDelivered[Orders]) should return seven represented orders. These formulas answer different questions even though both involve counting.
Use =SUM(tblCityDelivered[Total Sales]) for the amount control. If it matches the source but Pune and Nashik are incorrect, investigate group labels or source mapping. An overall total can remain unchanged when activity is assigned to the wrong city, so retain city-level checks as well.
3. Keep the full report and the Delivered report separate
Restore the original ten-order scope explicitly
The original course also has a broader City-and-Platform example based on ten records. It includes cancelled and returned orders, so its total is different. Create a separate sheet named AllStatusSource and enter this complete fixture in A1:F11. Do not append it to the seven-record table, which would repeat the delivered records.
| Order ID | City | Platform | Amount | Mins | Status |
|---|---|---|---|---|---|
| BLK-1001 | Pune | FreshGo | 64 | 9 | Delivered |
| BLK-1002 | Nashik | FreshGo | 270 | 12 | Delivered |
| AMN-1003 | Pune | MarketRush | 110 | 14 | Delivered |
| BLK-1004 | Nagpur | FreshGo | 240 | 11 | Cancelled |
| AMN-1005 | Kolhapur | MarketRush | 232 | 16 | Delivered |
| BLK-1006 | Pune | FreshGo | 150 | 8 | Delivered |
| BLK-1007 | Solapur | FreshGo | 1299 | 18 | Delivered |
| AMN-1008 | Sambhaji Nagar | MarketRush | 195 | 10 | Returned |
| BLK-1009 | Pune | FreshGo | 220 | 13 | Cancelled |
| BLK-1010 | Nashik | FreshGo | 90 | 17 | Delivered |
The platform names are the fictional labels used in this lesson. The order IDs, cities, amounts, minutes and statuses retain the original mini-dataset's values. Minutes on a non-delivered record should not automatically be described as completed-delivery duration; its meaning needs a separate operational definition.
- Create the Table
tblAllStatusGroupPracticeand import it asAllStatusDetail. - Validate text fields, numeric Amount and numeric Mins before calculating summaries.
- Create a Reference named
AllCityPlatform. - Group by City and Platform using Advanced, with Sum Amount and Count Rows.
- Create a separate Reference from AllStatusDetail named
DeliveredFromAll. - In DeliveredFromAll, filter Status to Delivered before grouping or creating another summary Reference.
Read the two populations correctly
All ten rows total 2,870. The seven delivered rows total 2,215. The two cancelled rows total 460, and the one returned row contains 195. The reconciliation is 2,215 plus 460 plus 195 equals 2,870. It explains the difference without calling either summary a calculation error.
| City | Platform | Total Amount | Rows |
|---|---|---|---|
| Pune | FreshGo | 434 | 3 |
| Pune | MarketRush | 110 | 1 |
| Nashik | FreshGo | 360 | 2 |
| Nagpur | FreshGo | 240 | 1 |
| Kolhapur | MarketRush | 232 | 1 |
| Solapur | FreshGo | 1299 | 1 |
| Sambhaji Nagar | MarketRush | 195 | 1 |
After the Delivered filter, City plus Platform produces five groups instead of seven. Pune FreshGo becomes 214 across two orders; Pune MarketRush remains 110 across one. Nashik remains 360 across two, Kolhapur 232 across one and Solapur 1,299 across one. Nagpur and Sambhaji Nagar have no delivered records in this fixture.
Keep status filters before the summary that needs them
If you group only by City and discard Status, you cannot later filter the city summary back to Delivered accurately. The status-specific detail has already been combined. Return to the earlier detailed step or build a separate Reference with the correct filter before grouping.
A useful alternative is grouping by City and Status when the report intentionally compares statuses. Its output grain is different from a city-only report. Do not join that multi-status output to a one-row-per-city target and then add the repeated target values across statuses without a deliberate calculation rule.
4. Choose a calculation that matches the question
Sum, Count Rows, Average, Min and Max
For the three delivered Pune orders, Sum Amount is 324, Count Rows is three, Average Amount is 108, Min Amount is 64 and Max Amount is 150. Each calculation describes a different aspect of the same group. A maximum does not tell you which customer placed the order unless you also retain or retrieve the corresponding record.
- Sum: total the compatible measure values in a group.
- Count Rows: count source records, with the business meaning determined by their grain.
- Average: describe the mean of the defined measured population.
- Min and Max: find the lowest and highest values in a selected field.
- All Rows: keep a nested table of contributing detail for further work.
Do not sum a field simply because it is numeric. Store codes, phone numbers and calendar years may use digits without being additive measures. A running balance or a percentage may also need a different calculation from a transaction amount. State the units and denominator before selecting an operation.
Use exact population labels
An average delivery duration should describe the records whose duration is meaningful and available. In the ten-row fixture, filter to Delivered before describing Mins as delivered-order time. The seven values sum to 94 minutes, giving approximately 13.43 minutes per measured delivered order.
If a duration is missing, the count of measured durations differs from the number of delivered orders. Report both when that distinction matters. Calling a mean “average across all delivered orders” would be misleading if some delivered orders lack valid measurements and their durations remain unknown.
Inspect a small M step without memorizing everything
The query editor records your settings as M. This example summarizes a preceding step named DeliveredDetail. Read it as “group by City, then calculate two values for each group.” It is an illustration of the grouping step, not a replacement for source validation.
Table.Group(
DeliveredDetail,
{"City"},
{
{"Total Sales", each List.Sum([Amount]), type nullable number},
{"Orders", each Table.RowCount(_), Int64.Type}
}
)Inside an aggregation, Amount refers to that group's amount values, while the underscore in Table.RowCount represents the group's table. The result names become output columns. If your preceding query or step has another name, adapt the reference rather than pasting an undefined identifier.
5. Keep missing amounts visible beside their summaries
A missing value changes what the total can claim
Work in a copy of the seven-order source. Replace the Pune amount 110 with a genuinely missing value that appears as null in Power Query. The city still has three order records, but only two known amounts: 64 and 150. Their known subtotal is 214. The complete city's amount is not established because the third order amount is unknown.
Count Rows remains three. A count of non-null Amount values becomes two. An average over the two known amounts is 107. Dividing the known subtotal by all three orders gives approximately 71.33, which treats the unknown contribution as if it added nothing. That is not the same question as the average of the known observations.
A numeric zero is a recorded measurement
Restore the fixture in a separate copy and replace 110 with numeric zero. Now all three Pune amounts are present: 64, zero and 150. The total is again 214, but the measured count is three and the mean is approximately 71.33. The total alone cannot distinguish this case from missing data.
- Original Pune: three rows, three known amounts, total 324, mean 108.
- One unknown amount: three rows, two known amounts, known subtotal 214, known-only mean 107.
- One recorded zero: three rows, three known amounts, total 214, mean approximately 71.33.
- All amounts unknown: three rows and zero known amounts; the complete total and mean remain unknown.
Microsoft's List.Sum returns null when there are no non-null values. Do not automatically turn that result into zero for a business report. An empty set of usable measurements is different from a measured group whose amounts genuinely sum to zero.
Count valid measurements after validating their type
A custom aggregation can use List.NonNullCount([Amount]) to count non-null values. Its name does not mean “count only verified money.” If text or errors remain, a non-null count is not a substitute for type and quality checks. Validate the numeric field and inspect conversion errors first.
For an explicitly known-only mean, remove nulls from a validated numeric list, check whether anything remains and then calculate the average. A practical output can include Orders, Known Amounts, Missing Amounts and Known Subtotal. The report then explains its coverage instead of using a polished number to conceal uncertainty.
Replacing all errors with null also needs caution. An unknown amount supplied as blank is different from an invalid string caused by a broken import. Keep an exception report or a reason field so students can explain whether information is absent, malformed or deliberately excluded.
6. Lab 2: count lines, orders and customers separately
Use a source whose rows are product lines
Create a separate LineSource sheet with this fictional INR fixture. One row is one order line, identified by Order ID and Line together. Amount is the line amount, not a repeated whole-order total. Customer ID is an anonymized training identifier, and all four lines belong to Pune.
| Order ID | Line | Customer ID | City | Product | Amount |
|---|---|---|---|---|---|
| O-101 | 1 | C-01 | Pune | Rice | 60 |
| O-101 | 2 | C-01 | Pune | Milk | 40 |
| O-102 | 1 | C-01 | Pune | Bread | 100 |
| O-103 | 1 | C-02 | Pune | Fruit | 200 |
The four line amounts total 400. There are three orders: O-101 totals 100, O-102 totals 100 and O-103 totals 200. There are two customers, because C-01 placed two orders and C-02 placed one. The count of distinct complete rows is four, since every line is different.
- Create the Table
tblOrderLinesGroupPracticeand import it asOrderLineDetail. - Check that Order ID plus Line uniquely identifies each line and that Amount is numeric.
- Create a Reference named
CityLineSummary. - Group by City with Sum Amount and Count Rows, naming the latter Lines.
- Expect one Pune summary with total 400 and Lines four.
- Keep a separate Reference for distinct-order and distinct-customer work.
Build a distinct-order count with an explicit identity
In a Reference, keep only City and Order ID after confirming that an order belongs to one city in this fixture. Remove duplicate combinations of those two fields, then Group By City with Count Rows. Pune should have three distinct orders. This removal is a deliberate way to construct a set of identities, not a repair applied blindly to the monetary detail.
If order numbers are unique only within a platform, retain Platform as part of the identity. Otherwise, two unrelated platforms can both use O-101 and be incorrectly combined. Likewise, if one order legitimately spans multiple cities, summing city-level distinct counts does not necessarily give a global distinct-order count.
Build a distinct-customer count
In another Reference, validate Customer ID, keep City and Customer ID, remove duplicate combinations and group by City with Count Rows. The result is two known customers for Pune. Define how null, blank or invalid identifiers are handled; they should not silently become an invented additional customer.
Count distinct rows in the Group By dialog concerns entire rows in the table supplied to that operation. It is not automatically a customer count. Microsoft documents the separate Count distinct values menu operation as available in Power Query Online. For Excel, the explicit identity-table approach above makes the selected fields and exclusions visible.
Do not add distinct counts across overlapping groups
Imagine another record shows C-01 visiting Nashik. Pune still has two known customers and Nashik has one. Adding those city counts gives three city-customer memberships, while there are only two different customer IDs overall. C-01 appears in both cities.
For a global customer count, construct the distinct set at the global identity level. For city coverage, count city-customer pairs. Both can be useful, but they should have different labels. This same reasoning applies to distinct orders across categories and distinct products across stores.
Fault test: duplicate one complete line
Duplicate the first line, O-101 line one amount 60. The source now has five rows and totals 460. The distinct order count remains three, and the distinct customer count remains two. Unchanged distinct counts do not prove that the money is correct.
Investigate the duplicate line identity, compare all fields and apply the documented replay rule if it is an accidental repeat. Do not remove duplicate Order IDs from the original line table, because that would delete legitimate product lines such as milk from O-101. Restore the baseline before continuing.
7. Rebuild averages from compatible totals and counts
Equal-city and equal-order averages answer different questions
Return to the original seven delivered orders. Pune's mean amount is 324 divided by three, or 108. Nashik's is 360 divided by two, or 180. Kolhapur's is 232 and Solapur's is 1,299 because each has one order.
A simple average of those four city means is 454.75. That gives each city equal influence, regardless of its order count. The overall mean per order is 2,215 divided by seven, approximately 316.43. It gives each included order equal influence. Neither label should be used for the other calculation.
Build the overall order average
Keep each city's evidence
Retain both its amount total and its included order count.
Add compatible totals
324 plus 360 plus 232 plus 1,299 gives 2,215.
Add the matching counts
Three plus two plus one plus one gives seven orders.
Divide once at the requested level
2,215 divided by seven gives approximately 316.43 per included order.
Carry the denominator with the summary
If you save only a rounded average in each group, you lose information needed to recompute the exact combined mean. Retain the total and matching observation count. For duration, that means total valid measured minutes and the count of those same measured durations, not an unrelated count of all rows.
The line-source lab has another useful comparison. Its four lines average 100 each, while its three orders average approximately 133.33 each. The numerator is 400 in both cases, but the denominator changes from lines to orders. A correct calculation still needs the right business label.
Keep currency and period compatible
A ₹100 amount and a $100 amount do not become comparable because both are numeric. Keep a Currency grouping field or apply an explicitly defined conversion with rate, date and source before combining. Changing the display symbol does not convert the underlying economic value.
Likewise, a monthly total and a cumulative year-to-date total cannot be added as though they were separate monthly contributions. Document the reporting window and remove overlapping summary records before aggregation. These meaning checks belong before formatting a dashboard card.
8. Retain detail with All Rows and make ordering deliberate
A nested table keeps the contributing records together
Create a new Reference from DeliveredDetail. Group by City and add an All Rows aggregation named Details alongside Total Sales. Each city receives a table value containing its contributing records. Pune's nested table should contain the three original Pune orders, which provide an audit trail for 324.
Use the table value to inspect that group's records in the query editor. A small preview panel may not show every record; inspect the actual nested table when the full group matters. All Rows is useful for further query calculations, but a nested table is not an ordinary text value you can read as a worksheet cell.
A maximum amount does not resolve ties
The maximum delivered Pune amount is 150, belonging to BLK-1006. A future dataset could have two Pune orders tied at 150. If the report asks for every highest-value order, preserve every tied record. If it asks for one selected order, define a tie rule such as earliest valid timestamp followed by stable Order ID.
Do not combine Max Amount with an unrelated first customer name and assume they came from the same row. The customer and amount must be retrieved from the same selected record. Inspecting All Rows makes that requirement easier to understand before writing a more advanced extraction step.
Expanding detail can repeat the group total
If you expand Pune's three Details records while retaining Total Sales 324 on each, the output can contain 324 three times. Summing that repeated summary field gives 972 for Pune, which is wrong as a city total. Use the original line Amount for detail sums or keep the summary at its intended grain.
This is the same grain problem encountered when merging a city-level budget into individual orders. The summary value is useful as context on each row, but its repeated copies are not additional business activity. Decide how a downstream report will aggregate it before expanding or merging.
Sort for presentation after grouping
Table.Group does not guarantee the order of its output. If the report needs the largest city first, explicitly sort Total Sales descending. This fixture then shows Solapur, Nashik, Pune and Kolhapur. For stable ties, add a secondary City sort if that is the agreed display rule.
The optional M setting GroupKind.Local assumes rows sharing the complete grouping key are already contiguous. It does not sort the data for you. Do not add it as a general speed trick to an interleaved source containing Pune, Nashik and Pune again. Use the ordinary grouping approach for these beginner labs.
9. Refresh, investigate and hand over the summary
Test a controlled source change
Add BLK-1011, Pune, amount 80 to the seven-order source Table. Confirm it is inside the Table boundary. Refresh the detail and dependent summary, then inspect the loaded result. Expect eight orders totaling 2,295. Pune becomes 404 across four orders, with mean 101. The number of city summary rows remains four.
Refresh again without changing the input. The result should remain eight orders and 2,295, because the query recalculates from its current source instead of accumulating another copy of the new record. If a PivotTable or chart uses the loaded summary, refresh and reconcile that report separately after its source is current.
Distinguish a repeat from legitimate growth
In a separate baseline copy, duplicate BLK-1001 amount 64 instead. The result becomes eight rows totaling 2,279, with Pune 388 across four rows. The unchanged business identity suggests a possible replay, while the new ID in the previous experiment represented a new order. Compare record identity and fields before deciding which action is appropriate.
Repeated exports, inconsistent city labels, conversion errors and incomplete status filters can all produce surprising summaries. Inspect the earliest step where the unexpected result appears. Keep an exception report or review notes instead of deleting inconvenient rows until a control total happens to match.
Use a short acceptance record
- State the source, period, currency and row grain.
- List the status filter and any approved exclusions.
- Record source rows, valid identities and known-value coverage.
- Reconcile amount totals and represented-record counts.
- Check a few individual groups against their detail.
- Confirm the loaded output and dependent report are current.
A Reference creates a dependency on another query's output; it is not a frozen copy of yesterday's records. Changes upstream can affect every dependent summary. Keep query names descriptive and document shared transformations so a teammate can understand the effect of a source or filtering change.
10. Practice tasks with explained answers
Complete these tasks on a copy of the supplied fixtures. Open an answer after attempting the check. The twelve activities replace vague instructions such as “copy the method down” with actions that fit an actual query transformation.
1. Rebuild the smallest city summary.
Use the seven delivered rows. Expect four cities, represented orders seven and total 2,215. Pune is 324 across three orders. Do not include a worksheet grand-total row in the source Table.
2. Change one amount and predict the result.
Change BLK-1001 from 64 to 74. Pune increases from 324 to 334, and the grand total increases to 2,225. Counts stay three for Pune and seven overall.
3. Describe the output in one plain sentence.
“Each row summarizes one city's delivered orders in this fictional INR report.” Include the status and units because a city label alone does not describe the included population.
4. Compare all-status and Delivered totals.
The ten-row source totals 2,870. Delivered contributes 2,215, Cancelled 460 and Returned 195. These amounts reconcile exactly. They should not all be labeled completed-delivery sales.
5. Add a new valid order.
Add BLK-1011, Pune, 80 inside the seven-order source Table. After refresh, expect eight orders totaling 2,295 and Pune 404 across four. The city count remains four.
6. Break the source with a duplicate.
Repeat BLK-1001 in a baseline copy. Eight rows total 2,279 and Pune becomes 388. Investigate the repeated identity; Group By will not automatically distinguish an export replay from a real order.
7. Count the product-line fixture correctly.
The four lines represent three orders and two customers, with total 400. Count Rows gives lines at this grain. A separate distinct identity set is needed for orders or customers.
8. Reconcile the grouped output.
Add Total Sales across the city summary and compare it with the source Amount sum. Add Orders and compare with validated source order records. Also check city subtotals because an unchanged grand total can hide a wrong city assignment.
9. Test a separate foreign-currency fixture.
Create two fictional GBP orders of 12 and 18 in their own dataset. Their total is £30. Do not add that number to the INR report or change its currency symbol and call it a conversion.
10. Explain two common mistakes.
Counting product lines as orders overstates order volume. Averaging city averages gives each city equal influence rather than each order. Both can produce a plausible-looking result with the wrong meaning.
11. Teach the process aloud.
Describe the business question, one-row meaning, included population, grouping fields and aggregations. Finish with the total and count checks. A useful explanation includes a reason for each choice, not just a list of ribbon clicks.
12. Save a reusable practice workbook.
Save the source Tables, clearly named queries, loaded summary and Control sheet. Document the baseline and source-growth results. Keep the altered and duplicate experiments in separate copies so they do not contaminate the final accepted fixture.
11. Interview questions and quick checks
What changes when you group by City and Platform instead of City?
The output becomes one row per city-platform combination. Pune can have separate rows for FreshGo and MarketRush. The grand total can remain unchanged while the number and meaning of summary rows change.
Does a successful Sum prove that every amount is present?
No. Known values can add correctly while other amounts remain missing. Report valid-value coverage and exceptions. A known subtotal should not be presented as a complete population total without evidence.
How can you preserve detailed records for investigation?
Keep a validated detail query and create a Reference for each summary. All Rows can also retain a nested group table for further query work. Neither choice makes a source-change audit or reconciliation unnecessary.
When can you use Count Rows as Orders?
When the input has one validated record per included order under its complete identity rule. If rows are lines, updates or replays, Count Rows measures those records instead.
Why do city averages not simply add or average into an overall order mean?
City populations can have different sizes. Combine compatible totals and matching counts, then divide at the requested level. For this fixture, 2,215 divided by seven gives 316.43, while equal-city averaging gives 454.75.
Can a numeric identifier be summed meaningfully?
Usually not. The digits in an ID identify an entity; adding them does not describe its business activity. Choose aggregations from the field's meaning, not merely its detected data type.
Does Group By preserve the source row order?
Do not rely on an implicit order. Sort the result explicitly for presentation. GroupKind.Local is a separate technical option requiring contiguous matching keys, not an instruction to sort an arbitrary source.
What would you verify before publishing the summary?
Verify the population, grain, complete identities, numeric quality, missing-value coverage, totals, group-level samples and refresh state. Confirm that every metric label describes the calculation and its denominator accurately.
12. Revision cards
- Define one row. A city summary is different from an order or a product line.
- Filter before combining. Delivered-only totals need the right source population.
- Count the intended identity. Rows, orders and customers are separate measures.
- Carry coverage. Unknown amounts need visibility beside known subtotals.
- Keep totals and denominators. Rebuild a combined mean at the requested level.
- Reconcile after refresh. Correct query settings still need current source and loaded-output checks.
Continue with the Excel Task Hub for additional datasets. Treat its separate imported-order exercises according to their own fields and units. The most useful habit from this lesson is to state what one row means before deciding what to count, add, average or merge.