# microsoft/powerbi-desktop-samples architecture

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

- Interactive diagram: https://gitdiagram.com/microsoft/powerbi-desktop-samples
- Repository: https://github.com/microsoft/powerbi-desktop-samples

## Overview

##### Project type and purpose
- This is not a traditional codebase but a “resource monorepo” for Microsoft Power BI. It bundles:
- Sample PBIX reports (Monthly Desktop Blog Samples, Sample Reports, service samples)
- JSON Schema definitions (Report Theme JSON Schema, item-schemas)
- A Performance Analyzer export tool
- DAX backups
- Contribution guidelines and telemetry settings
- Its purpose is to provide reference implementations, schema definitions, and tooling for Power BI developers and report authors.

##### File structure
- Top‐level modules:
- Monthly Desktop Blog Samples – PBIX files organized by month/year
- Sample Reports – curated PBIX demos for various domains
- new-power-bi-service-samples & powerbi-service-samples – additional PBIX/PBIT and Excel templates for Power BI Service
- Report Theme JSON Schema – JSON Schema files (v2.114–v2.142) + images for theming reports
- item-schemas – machine-readable definitions for Power BI artifacts (common config, dataset, report)
- DAX – backup DB (.bak) and PBIX for Adventure Works DW
- Performance Analyzer – PBIX report, schema, and documentation
- Root files for licensing, README, telemetry info, security policy, CLA integration
- No runtime services—this is a static content repo with schema artifacts and sample files.

##### README
- Describes contribution workflow (GitHub CLA-bot)
- Instructs disabling telemetry in Power BI Desktop
- Summarizes location and purpose of each sample folder

a. Main components:
- GitHub Repository (monorepo)
- Module directories (Samples, Schemas, Tools)
- Developer Machine
- Power BI Desktop application
- JSON Schema Validator (built into Power BI or external editor)
- Microsoft Telemetry Service
- GitHub CLA-bot
b. Relationships & data flow:
– Developer clones repo from GitHub -> local disk
– Developer opens PBIX in Power BI Desktop
– Power BI Desktop loads schemas from “Report Theme JSON Schema” & “item-schemas” when validating theme files or model definitions
– If enabled, Power BI Desktop sends usage data to Microsoft Telemetry Service
– Developer submits PR -> GitHub CLA-bot checks for CLA -> merges into repo
c. Architectural patterns & principles:
– Monorepo grouping by functional area (samples vs. schemas vs. tools)
– Separation of concerns: sample data, tooling, schema definitions
– Declarative artifacts (JSON Schemas) consumed by clients
– Static content delivery—no in-repo backend services
d. Key technologies/frameworks:
– Power BI Desktop (.pbix/.pbit files)
– JSON Schema (json-schema.org)
– Git/GitHub (CLA-bot integration)
– Telemetry via Power BI usage settings

##### Elements
- Clear labels on each module/directory grouping
- Git clone (GitHub Repo → Developer Machine)
- File access (Developer Machine → Power BI Desktop)
- Schema validation (Power BI Desktop ↔ JSON Schemas on disk)
- Telemetry (Power BI Desktop → Telemetry Service)
- PR workflow (Developer → GitHub Repo → CLA-bot → Repo)
- Blue for on-disk/static content
- Orange for user interactions
- Green for external SaaS/services
- Gray for automation scripts/bots

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "GitHub Repository (Monorepo)"
        direction TB
        MonthlyDesktop["Monthly Desktop Blog Samples"]:::static
        SampleReports["Sample Reports"]:::static
        NewServiceSamples["new-power-bi-service-samples"]:::static
        LegacyServiceSamples["powerbi-service-samples"]:::static
        ReportTheme["Report Theme JSON Schema"]:::static
        ItemSchemas["item-schemas"]:::static
        DAX["DAX"]:::static
        PerfAnalyzer["Performance Analyzer"]:::static
        RepoMetadata["Contribution Guidelines & Repo Metadata"]:::static
    end

    Developer["Developer"]:::user
    DevMachine["Developer Machine"]:::user
    PowerBIDesktop["Power BI Desktop"]:::client
    JSONValidator["JSON Schema Validator"]:::service
    TelemetryService["Microsoft Telemetry Service"]:::external
    CLABot["GitHub CLA-bot"]:::automation

    MonthlyDesktop -->|files| DevMachine
    SampleReports -->|files| DevMachine
    NewServiceSamples -->|files| DevMachine
    LegacyServiceSamples -->|files| DevMachine
    ReportTheme -->|schemas| DevMachine
    ItemSchemas -->|schemas| DevMachine
    DAX -->|files| DevMachine
    PerfAnalyzer -->|tooling| DevMachine
    RepoMetadata -->|docs| DevMachine

    Developer -->|clone repo| DevMachine
    DevMachine -->|open PBIX/.pbit| PowerBIDesktop
    PowerBIDesktop -->|validate theme| ReportTheme
    PowerBIDesktop -->|validate model| ItemSchemas
    PowerBIDesktop -->|optional telemetry| TelemetryService
    PowerBIDesktop -->|use validator| JSONValidator

    Developer -->|submit PR| RepoMetadata
    RepoMetadata -->|triggers| CLABot
    CLABot -->|checks CLA| RepoMetadata

    classDef static fill:#cce5ff,stroke:#0366d6
    classDef user fill:#ffe5cc,stroke:#d58512
    classDef client fill:#ffdead,stroke:#d2a679
    classDef service fill:#e2e3e5,stroke:#6c757d
    classDef external fill:#ccffcc,stroke:#28a745
    classDef automation fill:#e0e0e0,stroke:#6c757d

    click MonthlyDesktop "https://github.com/microsoft/powerbi-desktop-samples/tree/main/Monthly Desktop Blog Samples/"
    click SampleReports "https://github.com/microsoft/powerbi-desktop-samples/tree/main/Sample Reports/"
    click NewServiceSamples "https://github.com/microsoft/powerbi-desktop-samples/tree/main/new-power-bi-service-samples/"
    click LegacyServiceSamples "https://github.com/microsoft/powerbi-desktop-samples/tree/main/powerbi-service-samples/"
    click ReportTheme "https://github.com/microsoft/powerbi-desktop-samples/tree/main/Report Theme JSON Schema/"
    click ItemSchemas "https://github.com/microsoft/powerbi-desktop-samples/tree/main/item-schemas/"
    click DAX "https://github.com/microsoft/powerbi-desktop-samples/tree/main/DAX/"
    click PerfAnalyzer "https://github.com/microsoft/powerbi-desktop-samples/tree/main/Performance Analyzer/"
    click RepoMetadata "https://github.com/microsoft/powerbi-desktop-samples/blob/main/README.md"
```
