Month-over-Month Growth
Intermediate · Write the code · from Build a Sales Performance Dashboard with KPI Analysis
From the lesson: Step 5: Calculate Month-over-Month Growth
Trends matter more than snapshots. A $50,000 month sounds great, but if last month was $80,000, there's a problem. Month-over-month growth shows whether the business is improving or declining.
Read this part of the lessonWrite a function monthly_growth(df) that:
1. Groups the DataFrame by the month column
2. Calculates total revenue per month
3. Calculates the percentage change from one month to the next
4. Prints each month's revenue and growth rate
Format: MONTH: $REVENUE (GROWTH%) where growth shows +/- sign.
For the first month (no previous month), print: MONTH: $REVENUE
The months should appear in order: January, February, March.
More Sales Report exercises
- Create and Prepare the Sales DataFrameIntermediate
- Calculate Sales KPIsIntermediate
- Revenue by Product and RegionIntermediate
- Find Top PerformersIntermediate
- Create a Summary ReportIntermediate
- Generate a Formatted ReportIntermediate
All Python exercises · 50 practice problems · Practical Projects quiz