Data Schema

The foundational data model driving all analytics.

Understanding the Data Foundation

This dashboard is powered by a relational star schema designed for performance and clarity. It consists of two types of tables: Dimension tables provide the "who, what, where, and when" context, while Fact tables contain the quantitative business measurements and transactions.

📘 Dimension Tables (Contextual Data)

1. dim_Date
Column NameData TypeDescription
DateKeyintUnique date in YYYYMMDD format
FullDatedateFull date
YearintYear component
MonthintMonth number (1–12)
MonthNamestrFull month name
WeekintISO week number
2. dim_Products
Column NameData TypeDescription
ProductIDintUnique identifier
SKUstrStock Keeping Unit
ProductNamestrProduct name with brand and model
BrandstrBrand name
CategorystrProduct category
UnitCostfloatUnit manufacturing/wholesale cost
3. dim_Retailers
Column NameData TypeDescription
RetailerIDintUnique retailer ID
RetailerNamestrRetailer company name
ChannelstrSales channel (e.g., Online, Key Account)
RegionstrCountry/region (UAE, KSA, etc.)
RFM_SegmentstrRecency-Frequency-Monetary segment

📊 Fact Tables (Transactional Data)

4. fact_Sales
Column NameData TypeDescription
TransactionIDintUnique transaction ID
DateKeyintForeign key to dim_Date
ProductIDintForeign key to dim_Products
RetailerIDintForeign key to dim_Retailers
SaleTypestr"Sell-In" or "Sell-Out"
UnitsSoldintNumber of units sold
UnitPricefloatSelling price per unit
TotalRevenuefloatRevenue = UnitsSold × UnitPrice
TotalCostfloatCost = UnitsSold × UnitCost
GrossProfitfloatProfit = Revenue - Cost
5. fact_Inventory
Column NameData TypeDescription
SnapshotDateKeyintDateKey (end of quarter)
ProductIDintForeign key to dim_Products
UnitsOnHandintInventory count at snapshot
InventoryValuefloatValue = UnitsOnHand × UnitCost
6. fact_Marketing_Campaigns
Column NameData TypeDescription
CampaignIDintUnique campaign ID
CampaignNamestrName of the marketing campaign
StartDateKeyintStart date (foreign key to dim_Date)
EndDateKeyintEnd date (foreign key to dim_Date)
CampaignCostfloatCost of running the campaign
AttributedRevenuefloatRevenue attributed to the campaign
ROIfloatReturn on Investment = (Revenue - Cost)/Cost
7. fact_JBP_Performance
Column NameData TypeDescription
JBP_IDintUnique Joint Business Plan ID
RetailerIDintForeign key to dim_Retailers
YearintYear of the JBP
TargetRevenuefloatTargeted revenue for the year
ActualRevenuefloatActual revenue achieved

🧭 Relationships (Primary Keys / Foreign Keys)

  • fact_Sales.DateKey, fact_Inventory.SnapshotDateKey, fact_Marketing_Campaigns.StartDateKey, fact_Marketing_Campaigns.EndDateKey → dim_Date.DateKey
  • fact_Sales.ProductID, fact_Inventory.ProductID → dim_Products.ProductID
  • fact_Sales.RetailerID, fact_JBP_Performance.RetailerID → dim_Retailers.RetailerID

Project Architecture & Workflow

To ensure a robust and scalable BI solution, the project was designed using standard UML (Unified Modeling Language) diagrams. These models provide a clear blueprint of the system's actors, structure, behavior, and deployment, facilitating cross-functional understanding and alignment.

1. Use Case Diagram

This diagram illustrates the interactions between different user roles (e.g., Sales Manager, Operations Analyst) and the BI system. It defines the key functionalities each user can perform, such as 'Analyze Sales Performance' or 'Monitor Inventory Levels'.

Use Case Diagram
2. Class Diagram

The Class Diagram details the static structure of the data model, showing the tables (classes), their attributes (columns), and the relationships between them. It is the technical blueprint for the star schema.

Class Diagram
3. Activity Diagram - E2E Workflow

This diagram visualizes the end-to-end business process, from data extraction from source systems (ETL), through data modeling in Power BI, to the final report consumption by business users.

Activity Diagram
4. Sequence Diagram: Margin Analysis

This diagram shows a specific user interaction over time, detailing the calls between the user, the Power BI front-end, the DAX engine, and the data model as a user filters for a product to analyze its margin.

Sequence Diagram
5. State Machine Diagram: JBP Lifecycle

This diagram models the different states a Joint Business Plan can be in, from 'Draft' and 'Active' to 'Underperforming' and 'Completed', and the events that trigger transitions between them.

State Machine Diagram
6. Deployment Diagram: Architecture

This diagram illustrates the physical deployment, showing source databases, the Power BI Gateway for data refresh, the Power BI Service, and end-user devices.

Deployment Diagram