Sales are the dollar amount collected from completed transactions. In a dataset, each row records sales for a particular combination of date, product, customer segment, gender, age group, and state. section 6.4.1 section 6.1.2
Sales provide the basis for several dashboard metrics:
- Total sales adds every value in the Sales column for the selected slice of data. section 6.4.1
- Gross margin measures sales minus acquisition costs, while margin percentage expresses gross margin as a percentage of total sales. section 6.4.1
- Average transaction value divides total sales by the number of transactions represented by the selected rows. section 6.4.1
Calculating sales metrics
For rows with sales of $500, $300, and $200, total sales equal $1,000. If gross margin totals $400, margin percentage is 40%. With 23 transactions, average transaction value is $43.48. section 6.4.1
A Python configuration can represent total sales as a metric function: df["Sales"].sum(). Related ratio metrics should guard against a zero denominator before dividing. section 6.4.2
| Date | Product | State | Sales | Gross Margin | Transactions | |------------|--------------|-------|--------|--------------|--------------| | 2024-01-01 | Fountain Pen | CA | 500 | 200 | 10 | | 2024-01-01 | Notebook | TX | 300 | 120 | 5 | | 2024-01-01 | Pencil | NY | 200 | 80 | 8 |
Inspect a small tabular dataset showing how sales, gross margin, and transactions combine into dashboard metrics. section 6.4.1


