The Challenge
El equipo de ventas comerciales dependía de procesos manuales ineficientes para la consolidación de datos. La extracción de archivos planos desde el ERP (SAP) y su posterior transformación y visualización en presentaciones de PowerPoint consumía múltiples días de trabajo a la semana.
Esta latencia en los datos impedía la toma de decisiones ágiles, aumentaba el riesgo de errores humanos y dificultaba la generación de pronósticos de ventas precisos para evitar quiebres de stock.
What We Built
Diseñamos y desplegamos un pipeline ETL (Extract, Transform, Load) automatizado:
- Flujos en Power Query para ingestar, limpiar y transformar exportaciones planas de SAP de manera programática
- Dashboard interactivo en Power BI que centralizó tres fuentes de datos críticas
- Enfoque modular con filtros granulares por SKU, distribuidor y temporalidad
- Eliminación de reportes estáticos individuales en favor de una solución dinámica
Results
La automatización redujo el tiempo de ciclo de generación de reportes en un 80%, liberando decenas de horas semanales para el equipo. La disponibilidad de datos limpios permitió desarrollar modelos de pronóstico de ventas mensuales con una precisión sostenida de +/- 15%.
El sistema fue adoptado por más de 15 usuarios, a quienes capacitamos personalmente para asegurar la mantenibilidad a largo plazo de la solución.
Tools & Technologies
- Power BI & Power Query (M Language)
- SAP ERP (Extracción de datos)
- Modelado de datos relacionales
- Forecasting estadístico
Architecture Decisions
Why Power Query instead of Python scripts? The Castrol team needed to maintain and modify the ETL process themselves after I left. Power Query runs inside Excel and Power BI, tools they already use daily. A Python script would require a developer to maintain it. Power Query lets the business analysts adjust transformations, add new data sources, and fix issues without technical support.
Why incremental loading instead of full refresh? The SAP data exports are large (500MB+ per file). Running a full refresh every day would take 45 minutes and consume significant server resources. I implemented incremental loading that only processes new or changed records, reducing daily refresh time to 3 minutes. This also allows the team to run updates multiple times per day without performance issues.
Why a star schema instead of a flat table? The initial version used a single flat table with all data. This worked for 10,000 rows but became unusable at 500,000 rows. I redesigned it as a star schema with a central fact table (sales transactions) and dimension tables (products, distributors, time periods). This reduced query time by 80% and made the data model easier to understand for non-technical users.
Cost Analysis
Before automation: The commercial team had 3 analysts spending 15 hours per week each on data consolidation and reporting. At $40/hour loaded cost, that's $1,800/week or $7,200/month in labor costs dedicated to manual data work.
After automation: The same 3 analysts now spend 2 hours per week reviewing the automated reports and making strategic decisions. That's $240/week or $960/month. The Power BI Pro license costs $10/user/month, so total operating cost is $990/month.
Net savings: $6,210/month or $74,520/year. The automation paid for itself in the first month. Additionally, the team can now generate reports that were previously impossible (cross-distributor comparisons, trend analysis) because the data is clean and structured.