# Nova PowerBI Dashboard — Import Guide


This guide documents how to import Nova's metrics views into PowerBI
via the folder connector, and suggests a starter visual model.

## Import via folder connector

1. Open PowerBI Desktop.
2. **Get Data** → **Folder** → navigate to `metrics/powerbi/`.
3. PowerBI discovers all CSV/JSON files in the folder.
4. Combine the files — PowerBI creates a single query per file.

## Starter visual model

### Suggested joins
- `fact_run` ←→ `fact_decision` on `run_id` (run-level decision path)
- `fact_run` ←→ `fact_cost_estimate` on `run_id` (run-level cost)
- `fact_capability` ←→ `dim_capability` on `capability_id` (capability lookup)
- `fact_capability` ←→ `dim_milestone` on `milestone` (milestone lookup)

### Suggested visuals (4 starter visuals)

1. **Capability Health over Time** — bar chart: `fact_capability.status`
   grouped by `run_at_utc`. Shows Verified/Skipped/Broken/Decayed trend.
   Source: `fact_capability.csv`.

2. **Confidence Distribution** — histogram: `fact_confidence.score`.
   Shows the distribution of confidence scores across all runs.
   Source: `fact_confidence.csv`.

3. **Decision Accuracy** — KPI card: count of `fact_decision` where
   `outcome = 'succeeded'` ÷ total `fact_decision` rows. Shows AI
   Decision Accuracy (NORTH_STAR target ≥99.5%).
   Source: `fact_decision.csv`.

4. **Cost Trend** — line chart: `fact_cost_estimate.delta_usd` over
   `estimated_at`. Shows pre-apply cost estimate trend (Infracost).
   Source: `fact_cost_estimate.csv`.

## Placeholder views (deferred metrics)

The 8 `placeholder_*.csv` files contain headers only (no data rows).
Each has a companion `placeholder_*.json` with the schema metadata
(columns, blocking decision, description). When the blocking decision
lifts (e.g., D-096 for live AWS), the collector will populate these
views and PowerBI will automatically pick up the data.

## Data refresh

The export is regenerated by running:
```bash
python3 core/metrics/collector.py   # rebuilds nova_metrics.db
python3 core/metrics/powerbi_export.py  # exports to metrics/powerbi/
```

In PowerBI, click **Refresh** to pick up the updated CSV/JSON files.

## Honesty model

Every metric in the export is `grounded` (cites a source file), `derived`
(documented formula), or `deferred` (cites a blocking decision ID). See
`docs/METRICS.md` (P4) for the canonical catalog and `docs/METRICS_VIEWS.md`
for the column-level data dictionary.