Dataset Guide — Financial Performance Analysis¶
Source¶
Dataset: Microsoft Financial Sample (or equivalent synthetic P&L data)
URL: https://learn.microsoft.com/en-us/power-bi/create-reports/sample-financial-download
File: Financial Sample.xlsx
Granularity: One row per transaction (segment × country × product × month)
Column Descriptions¶
| Column | Type | Description |
|---|---|---|
Segment |
str | Business segment (Government, Midmarket, Enterprise, Small Business, Channel Partners) |
Country |
str | Country of sale |
Product |
str | Product name |
Discount Band |
str | None, Low, Medium, High |
Units Sold |
float | Quantity |
Manufacturing Price |
float | Cost to produce one unit |
Sale Price |
float | List price per unit |
Gross Sales |
float | Units × Sale Price (before discount) |
Discounts |
float | Total discount given |
Sales |
float | Net sales (Gross Sales − Discounts) |
COGS |
float | Cost of Goods Sold (Units × Manufacturing Price) |
Profit |
float | Sales − COGS |
Date |
date | Transaction date |
Month Number / Month Name / Year |
— | Date parts |
Key Financial Relationships¶
Gross Sales = Units Sold × Sale Price
Sales (Net) = Gross Sales − Discounts
COGS = Units Sold × Manufacturing Price
Profit = Sales − COGS
Gross Margin % = Profit / Sales
These relationships let you validate the data — if Profit ≠ Sales − COGS, there's an error.
Adding a Budget for Variance Analysis¶
The base dataset has actuals only. For variance analysis, you need a budget. Either: 1. Use a provided budget file, OR 2. Create a synthetic budget (e.g., budget = prior year actuals × 1.1 growth target)
# Synthetic budget example: 10% growth on prior period
budget = actuals.copy()
budget["budget_sales"] = budget["Sales"] * 1.10
Data Quality Notes¶
- Clean dataset — designed for Power BI learning, minimal cleaning needed
- Validate the financial math — recompute Profit and compare to the given column
- Watch for date formats — Excel dates may import as serial numbers
- Discount bands are categorical — useful for segmentation
Quick Exploration¶
import pandas as pd
df = pd.read_excel("Financial Sample.xlsx")
df.columns = df.columns.str.strip() # Excel often adds trailing spaces
print(df.shape)
# Profit by segment
print(df.groupby("Segment")[["Sales", "Profit"]].sum().round(0))
# Margin by segment
seg = df.groupby("Segment").agg(sales=("Sales","sum"), profit=("Profit","sum"))
seg["margin_pct"] = (seg["profit"] / seg["sales"] * 100).round(1)
print(seg.sort_values("margin_pct", ascending=False))