# hajarlha/powerbi-sales-dashboard architecture

> Architecture diagram of the GitHub repository hajarlha/powerbi-sales-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hajarlha/powerbi-sales-dashboard
- Repository: https://github.com/hajarlha/powerbi-sales-dashboard

## Overview

##### Project type and purpose
- This is a self-contained Business Intelligence dashboard built in Power BI Desktop using a CSV dataset (“Global_Superstore2.csv”) to analyze global retail sales (2011–2014).
- It is not a multi-tier web app but an analytical pipeline: data ingestion → transformation → modeling → visualization → user interaction.

##### Main components
a. Data Source
- The raw CSV file in `/dataset/Global_Superstore2.csv`.
b. ETL / Data Preparation
- Power Query within Power BI Desktop: data cleaning, type conversions, filter steps.
c. Data Model & Analytical Engine
- In-memory Tabular Model (VertiPaq engine).
- DAX calculation layer (measures: Profit Margin %, Average Order Value).
d. Visualization Layer
- Report canvas: KPI cards, line charts, bar charts, maps, slicers (filters).
e. Output Artifacts
- `.pbix` file (in `/dashboard/orders.pbix`).
- Exported PDF (`orders.pdf`).
- Screenshots folder (for static representation).
f. User Interaction
- Filters/slicers (Date, Region, Country) driving dynamic queries against the model.
g. (Optional) Power BI Service
- If deployed to Power BI Service, include workspace → report → dashboard tiles.

##### Architectural patterns & design principles
- Layered architecture: Source → ETL → Model → Presentation
- In-memory analytics for fast query performance
- Reusable DAX measures decouple business logic from visuals
- Interactive filters (bi-directional context propagation)

##### Technologies & frameworks
- Power BI Desktop (Power Query UI, Data Model designer, Report canvas)
- M language (Power Query transformations)
- DAX language (measures and calculated columns)
- VertiPaq storage engine
- PDF export & Power BI Service (optional)

##### Final checklist
- Components: Data source, ETL, Model, DAX, Visuals, Export/Service
- Detail: Capture every step from CSV import through user-driven filter loops

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Ingestion Layer
    source["CSV Source"]:::ingest
    click source "https://github.com/hajarlha/powerbi-sales-dashboard/blob/main/dataset/Global_Superstore2.csv"

    subgraph "ETL / Data Preparation"
        pq["Power Query (M)"]:::ingest
        click pq "https://github.com/hajarlha/powerbi-sales-dashboard/blob/main/dashboard/orders.pbix"
    end

    subgraph "In-Memory Model & Calculation"
        model["Tabular Model<br/>(VertiPaq)"]:::model
        dax["DAX Calculation Layer"]:::model
        click model "https://github.com/hajarlha/powerbi-sales-dashboard/blob/main/dashboard/orders.pbix"
        click dax "https://github.com/hajarlha/powerbi-sales-dashboard/blob/main/dashboard/orders.pbix"
    end

    subgraph "Visualization & Output"
        visuals["Report Canvas<br/>(Charts, Slicers, Maps)"]:::visual
        pbix["Power BI Desktop File (.pbix)"]:::output
        pdf["Exported PDF Report"]:::output
        snaps["Static Visualization Snapshots"]:::output
        click visuals "https://github.com/hajarlha/powerbi-sales-dashboard/blob/main/dashboard/orders.pbix"
        click pbix "https://github.com/hajarlha/powerbi-sales-dashboard/blob/main/dashboard/orders.pbix"
        click pdf "https://github.com/hajarlha/powerbi-sales-dashboard/blob/main/dashboard/orders.pdf"
        click snaps "https://github.com/hajarlha/powerbi-sales-dashboard/tree/main/screenshots/"
    end

    user["User Interaction"]:::user

    %% Data flow and interactions
    source -->|"Import CSV"| pq
    pq -->|"Load to VertiPaq"| model
    model -->|"Evaluate Measures"| dax
    dax -->|"Render Visuals"| visuals
    user -->|"Apply Filters"| dax
    visuals -->|"Export/Pubish"| pbix
    visuals -->|"Export to PDF"| pdf
    visuals -->|"Snapshots"| snaps

    %% Styling
    classDef ingest fill:#D0E7FF,stroke:#4A90E2,color:#000;
    classDef model fill:#DFF2BF,stroke:#7ABA00,color:#000;
    classDef visual fill:#FFE7C1,stroke:#E67E22,color:#000;
    classDef output fill:#F0F0F0,stroke:#999,color:#000;
    classDef user fill:#FADBD8,stroke:#C0392B,color:#000;

    %% Legend
    subgraph Legend
        L1["Data Ingestion"]:::ingest
        L2["Model & Calculation"]:::model
        L3["Visualization"]:::visual
        L4["Output"]:::output
        L5["User"]:::user
    end
```
