End-to-End Analytics Engineering & Business Intelligence Project
An end-to-end Supply Chain Sales Analytics project demonstrating real-world analytics engineering, data warehousing, and BI reporting using PostgreSQL and Power BI.
This project follows industry-grade BI architecture: staged ingestion, dimensional modeling, partitioned fact tables, optimized reporting views, and dashboard-driven insights.
- Designed a scalable star-schema data warehouse
- Built partitioned fact tables for large-scale analytics
- Implemented staged ETL pipelines using pure SQL
- Clearly separated warehouse logic from reporting logic
- Optimized performance using indexes and materialized views
- Delivered production-ready Power BI dashboards
- Performed customer lifecycle, RFM, and ABC analysis
- Enable analytics-ready reporting for supply chain data
- Analyze sales performance, delivery behavior, and customer retention
- Identify high-value customers and high-impact products
- Reduce dashboard load time using pre-aggregated views
- Support business decision-making through KPI-driven insights
The dataset represents order-itemβlevel supply chain transactions, including:
- Orders and order items
- Customer demographics and behavior
- Products, categories, and departments
- Shipping modes, delivery timelines, and fulfillment metrics
- Sales, profit, and quantity measures
Raw data is ingested as text and progressively refined through typed staging, warehouse modeling, and reporting views.
staging.dataco_raw (raw ingestion β all text)
β
staging.dataco_clean (typed & cleaned staging)
β
warehouse schema
βββ dim_date
βββ dim_customer
βββ dim_product
βββ fact_order_items (partitioned by order year)
β
reports schema
βββ Reporting Views (per dashboard page)
βββ Materialized Views (RFM, ABC)
β
Power BI Dashboards
This layered architecture mirrors modern analytics engineering workflows used in production BI systems.
warehouse.fact_order_items
- Grain: One row per order item
- Partitioning: By order year
- Measures: Sales, profit, quantity, shipping duration, delivery delay indicators
dim_dateβ Calendar attributes (year, month, week, weekday/weekend)dim_customerβ Customer demographics and behavioral attributesdim_productβ Product, category, and department hierarchy
This design enables high-performance joins and BI-friendly consumption.
- Ingest raw CSV into
staging.dataco_raw - All columns stored as
TEXT - Initial data profiling and validation
- Safe type casting (numeric, date, timestamp)
- Parsing order and shipping timestamps
- Stored in
staging.dataco_clean
- Star schema creation
- Surrogate keys for dimensions
- Fact table partitioned by year
- Dimension population
- Fact loading with surrogate key mapping
- Referential integrity checks
- Foreign key and filter indexes
- Composite indexes for BI queries
- Materialized views for heavy aggregations
All dashboards consume data exclusively from the reports schema.
| SQL File | Dashboard Purpose |
|---|---|
01_sales_dashboard.sql |
Sales Overview |
02_geographical_dashboard.sql |
Geographical Analysis |
03_product_customer_dashboard.sql |
Product & Customer Insights |
04_delivery_behavior_dashboard.sql |
Delivery Behavior |
05_customer_analytics.sql |
Customer Lifecycle & Retention |
06_materialized_views.sql |
RFM & ABC Optimizations |
Each SQL file has a clear purpose header, defines a single reporting contract, and is safe to re-run (DROP + CREATE pattern).
- New vs Returning vs Churned customers
- Customer lifetime behavior tracking
- Retention and churn risk indicators
- Recency, Frequency, Monetary scoring
- Customer segmentation:
- Loyal Customers
- Potential Loyalists
- Needs Attention
- At Risk / Lost
- Revenue-based product classification:
- A: High-value products
- B: Medium-value products
- C: Low-value products
Materialized views significantly reduce Power BI query load time.
The Power BI report is built entirely on SQL reporting views.
- Sales Overview
- Geographical Analysis
- Product & Customer Insights
- Delivery Behavior
- Customer Lifecycle & Retention
Supply-Chain-Sales-Analytics/
β
βββ powerbi/
β βββ Supply_Chain_Sales_Analytics.pbix
β
βββ screenshots/
β βββ dashboard previews (.png)
β
βββ sql/
β βββ staging/
β β βββ 01_staging_raw_and_clean.sql
β β
β βββ warehouse/
β β βββ 01_dimensions.sql
β β βββ 02_fact_order_items_partitioned.sql
β β βββ 03_fact_order_items_indexes.sql
β β
β βββ reports/
β βββ 01_sales_dashboard.sql
β βββ 02_geographical_dashboard.sql
β βββ 03_product_customer_dashboard.sql
β βββ 04_delivery_behavior_dashboard.sql
β βββ 05_customer_analytics.sql
β βββ 06_materialized_views.sql
β
βββ .gitignore
βββ README.md
- PostgreSQL
- SQL (Analytics Engineering)
- Power BI
- Data Warehousing
- Star Schema Modeling
- Table Partitioning & Indexing
- Git & GitHub
Mayuresh Ahire Data Analyst | Analytics Engineering | Business Intelligence
- GitHub: mayuresh0711
- LinkedIn: Mayuresh Ahire




