Leadership couldn’t see if the business was actually making money. Revenue sat in one silo, costs in another, and no one had a trusted monthly view of margin. Without clarity, decisions on hiring, pricing, and fundraising risked being guesswork. Lunexa Insights delivered a transparent revenue and margin tracker that surfaced true month-over-month profitability, turning uncertainty into confident, data-backed growth moves.
The client’s finance team had siloed data across billing and expense systems. Without a consolidated monthly P&L, they were unable to:
Senior Data Analyst @ Lunexa Insights — designed and delivered the analysis end‑to‑end.
1 week (from prototype to executive‑ready deliverables).
1. Revenue Expansion
Revenue grows steadily month-over-month after launch, recognition aligns with subscription duration.
# subs_monthly, rev_monthlysubs = subscriptions_df.copy()subs['months_active'] = pd.to_numeric(subs['months_active'], errors='coerce').clip(lower=1)subs['subscription_revenue'] = pd.to_numeric(subs['subscription_revenue'], errors='coerce')subs['monthly_rev'] = subs['subscription_revenue'] / subs['months_active']expanded_rows = []for _, row in subs.iterrows(): for m in range(int(row['months_active'])): month_key = (row['start_date'] + pd.offsets.MonthBegin(0)) + pd.DateOffset(months=m) month_key = pd.Timestamp(year=month_key.year, month=month_key.month, day=1) expanded_rows.append({'customer_id': row['customer_id'], 'product_tier': row['product_tier'], 'month': month_key, 'monthly_rev': row['monthly_rev']})subs_monthly = pd.DataFrame(expanded_rows)rev_monthly = subs_monthly.groupby('month', as_index=False)['monthly_rev']\ .sum().rename(columns={'monthly_rev':'revenue'})
2. Monthly Cost Consolidation
# 4) Cost-type breakdown by month (stacked area)costs_breakdown_long = costs_breakdown_df.sort_values('month')fig_png = px.area(costs_breakdown_long, x='month', y='cost_value', color='cost_type', title='Monthly Costs by Type (Stacked)')fig_png.update_layout( font=dict(family='Inter, Arial, Sans-Serif'), title=dict(font=dict(size=20), x=0.5), plot_bgcolor='white', paper_bgcolor='white', xaxis=dict(showgrid=False, showline=True, linecolor='black'), yaxis=dict(showgrid=True, griddash='dot', gridcolor='lightgray', showline=True, linecolor='black'))png_bytes = pio.to_image(fig_png, format='png', width=800, height=600, scale=2)display(Image(png_bytes))print('Rendered stacked area chart: Monthly Costs by Type')
4. Gross Margin Analysis
# Create the Monthly Gross Margin bar chartfig_png = px.bar(pnl_df.sort_values('month'), x='month', y='gross_margin', title='Monthly Gross Margin')# Apply Blue Theme stylingfig_png.update_layout( font=dict(family='Inter, Arial, Sans-Serif'), title=dict(font=dict(size=20), x=0.5), plot_bgcolor='white', paper_bgcolor='white', xaxis=dict(showgrid=False, showline=True, linecolor='black'), yaxis=dict(showgrid=True, griddash='dot', gridcolor='lightgray', showline=True, linecolor='black'))# Convert to PNG and displaypng_bytes = pio.to_image(fig_png, format='png', width=800, height=600, scale=2)display(Image(data=png_bytes))print('Monthly Gross Margin bar chart rendered successfully')print('')print('Key code components for this visualization:')print('1. Calculate gross_margin = revenue - costs')print('2. Use px.bar() with month on x-axis, gross_margin on y-axis')print('3. Sort data by month for proper chronological display')print('4. Apply Julius Business Theme with Inter font and clean styling')print('5. Export as high-resolution PNG (800x600, scale=2)')# Show a sample of the data being plottedprint('')print('Sample of gross margin data:')print(pnl_df[['month', 'revenue', 'costs', 'gross_margin']].head())
Delivered a single source of truth dashboard with revenue, costs, gross margin, and GM%.
Leaders can now see margin drivers and cost mix in one view.
Profitability guardrails
Cost optimization plan
Revenue mix and pricing
Operational Instrumentation
By consolidating revenue and cost data into a monthly P&L tracker, Lunexa Insights gave the client clear visibility into their profitability journey. With transparent assumptions and actionable visuals, leadership can now manage resources more effectively, plan campaigns around margin trends, and build a sustainable growth strategy.
Copyright © 2025 Lunexa Insights. All rights reserved.