create-pbi-report
This Claude Code skill provides a step-by-step workflow for creating Power BI reports from scratch using the pbir CLI tool. Use it when users request new report creation, dashboard setup with KPIs, or multi-page report design. The skill handles model discovery, page layout configuration, theme application, visual placement and binding, filtering setup, formatting, validation, and publishing to ensure reports are properly structured without overlapping elements.
git clone --depth 1 https://github.com/data-goblin/power-bi-agentic-development /tmp/create-pbi-report && cp -r /tmp/create-pbi-report/plugins/reports/skills/create-pbi-report ~/.claude/skills/create-pbi-reportSKILL.md
# Creating Power BI Reports
Create and scaffold Power BI reports using `pbir` CLI. Install with `uv tool install pbir-cli` or `pip install pbir-cli`. Load the `pbir-cli` and `pbi-report-design` skills alongside this one.
## Vague or Underspecified Prompts
When the user's request lacks specific measures, audience context, structural preferences, or formatting direction (e.g., "make me a dashboard", "create something with KPIs"), consult **`references/vague-prompts.md`** before proceeding. Close the gap between intent and specification with targeted questions; then apply sensible defaults (sqlbi theme, executive dashboard pattern, model-driven KPI selection) for anything the user can't or won't specify.
## Rules
- Visuals must not overlap one another
- Favor theme changes over visual overrides for static formatting
- Favor extension measures with theme colors (like "bad") for conditional formatting
- Always create reports inside a named project folder (e.g., `sales-dashboard/Sales.Report`)
- Run `pbir validate` after every mutation
- New reports already include the **sqlbi** theme -- do NOT run `pbir theme apply-template` unless the user explicitly asks for a different theme
- New reports already include a default **Page 1** with a **textbox** visual for the page title at position (20,20) with height 90 -- do NOT add a new textbox; rename the existing page with `pbir pages rename` instead. **Place all visuals at y:120 or below** to avoid overlapping the title textbox.
## Quick Reference
1. Get the workspace and semantic model from the user. If the user wants to connect to Power BI Desktop or create a report with source data, explain that a published semantic model in Fabric or Power BI is required first.
2. Analyze the user's requirements. Consider missing information -- charts, filters, formatting, analyses. Use `AskUserQuestion` if something is unclear.
3. Consider missing semantic model objects -- not just what the user asks for, but targets (1 year prior), baselines (avg for period), or trend aggregations (14-day rolling) that enrich visuals.
4. Create a project folder and report (default format is PBIP):
```bash
mkdir -p /path/to/report-name
cd /path/to/report-name
pbir new report "Name.Report" -c "Workspace/Model.SemanticModel"
```
5. Rename the default page (do NOT add a new page unless the report needs multiple pages): `pbir pages rename "Name.Report/Page 1.Page" "Overview"`
6. Only if the user requests a custom theme: `pbir theme apply-template "Name.Report" template-name` (the sqlbi theme is already included by default)
7. Discover model fields: `pbir model "Name.Report" -d`
8. Query field values for filters or formatting: `pbir model "Name.Report" -q "EVALUATE VALUES('Table'[Column])"`
9. Inspect field data types: `pbir model "Name.Report" -d -t Table`
10. Add visuals (the page already has a textbox for the title): `pbir add visual kpi "Name.Report/Overview.Page" --title "Revenue"`
11. Configure query reduction (slicers + heavy visuals): see `references/interactivity.md`
12. Wire cross-filter overrides and page navigation: see `references/interactivity.md`
13. Add filters and slicers; configure slicer sync and reset: see `references/interactivity.md`
14. Validate: `pbir validate "Name.Report"`
15. Publish: `pbir publish "Name.Report" "Workspace.Workspace/Name.Report"`
16. Open in Fabric after publish: `pbir publish "Name.Report" "Workspace.Workspace/Name.Report" -o`
17. Or open locally in Power BI Desktop: `pbir open "Name.Report"`
## Step-by-Step Process
### Step 1: Understand the Business Process
Before creating visuals, explore the semantic model to understand the domain. Use `pbir model "Report.Report" -d` to inspect tables, columns, measures, and hierarchies. Consider:
- What domain does this model cover? (sales, finance, operations, logistics, etc.)
- What KPIs and measures matter most?
- What dimensions and hierarchies exist for slicing data?
- What time granularity makes sense? (daily, weekly, monthly, quarterly)
Present a concrete proposal via `AskUserQuestion` before building anything. The proposal should include:
- Which KPI cards to show and what measures they display
- What trend chart(s) to include and at what time granularity
- Which categorical breakdowns are most insightful
- What detail table/matrix to provide and with what hierarchies
- How filters should scope the data
Iterate on the design before executing -- revising a plan is cheaper than rebuilding visuals.
### Step 2: Identify Location and Connection
Determine where to create the report and what model it connects to. Use `AskUserQuestion` to understand the report's purpose, audience, and what decisions it should support.
```bash
pbir model # List all known reports/models
pbir connect MyWorkspace MyReport # Set active connection
```
If the user provides a workspace location, create the report locally in a project folder, then publish.
### Step 3: Create the Report
Create a project folder first, then the report inside it. Default format is PBIP.
```bash
mkdir -p sales-dashboard && cd sales-dashboard
pbir new report "Sales.Report" -c "MyWorkspace/Sales.SemanticModel"
```
The resulting structure:
```
sales-dashboard/
Sales.Report/
definition/
pages/
report.json
StaticResources/
definition.pbir
Sales.pbip
```
### Step 4: Rename Default Page and Add More Pages
The report comes with a default "Page 1" that already has a textbox for the page title. Rename it rather than creating a new page. Only add additional pages if needed.
```bash
pbir pages rename "Sales.Report/Page 1.Page" "Overview" # Rename default page
pbir add page "Sales.Report/Detail.Page" -n "Detail" # Add extra pages only if needed
pbir pages active-page "Sales.Report" "Overview"
```
### Step 5: Configure Theme (only if user requests)
The sqlbi theme is already included by default. Only modify theAutomatically invoke this skill whenever the user asks about Fabric tenant settings or Power BI tenant settings or auditing tenant settings. You can use this skill if the user mentions "Fabric administration".
Expert guidance for using the Fabric CLI (`fab`) to fully interact with Fabric workspaces, items, and configuration. Automatically invoke this skill whenever the user mentions "Fabric" or "Power BI Service" or a "Fabric/Power BI workspace".
TOM and ADOMD.NET guidance via PowerShell for connecting to Power BI Desktop's local Analysis Services instance. Covers model enumeration, DAX queries, metadata modification, annotations, calendar definitions, field parameters, query tracing, DAX library package management (daxlib.org), and the Desktop Bridge for reloading and screenshotting the report canvas. Automatically invoke when the user mentions "Power BI Desktop", "Analysis Services port", "TOM", "ADOMD", "daxlib", "DAX library", "DAX UDF package", or asks to "connect to PBI Desktop", "query PBI Desktop with DAX", "modify PBI Desktop model", "add a measure to PBI", "capture visual queries", "create a field parameter", "validate DAX", "intercept DAX queries", "install daxlib", "add DAX SVG", "add IBCS", "reload the report canvas", "screenshot a report page", "Desktop Bridge", or to work with the model and report in Power BI Desktop together.
Expert guidance for the Power BI Project (PBIP) file format; project structure, cross-cutting operations (renames, forking), and PBIX extraction/conversion. Automatically invoke when the user mentions PBIP, PBIX, .pbip/.pbism/.platform files, or asks about "PBIP project structure", "PBIP vs PBIX", "thin report vs thick report", "rename a table", "cascade rename", "fork a PBIP project", "convert pbix to pbip", "extract pbix", "what files are in a PBIP", "PBIP encoding", "definition.pbir", or discusses project-level file structure and post-rename verification.
Format reference for Power BI Enhanced Report (PBIR) JSON schemas and patterns. Automatically invoke when the user asks about PBIR JSON structure, visual.json properties, PBIR expressions, objects vs visualContainerObjects, theme inheritance, conditional formatting patterns, extension measures, bookmarks, field references, filter formatting, query roles, PBIR page structure, report wallpaper, or any PBIR metadata format question.
Direct TMDL file authoring and BIM-to-TMDL conversion for semantic models in PBIP projects. Automatically invoke when the user asks to "edit TMDL", "add a measure in TMDL", "TMDL syntax", "fix formatString", "fix summarizeBy", "TMDL indentation", "convert BIM to TMDL", "add a column description", "create a calculated column in TMDL", or mentions .tmdl file editing or BIM-to-TMDL migration.
Deneb visual creation, Vega/Vega-Lite spec authoring, and Deneb best practices for PBIR reports. Automatically invoke whenever the user mentions "Deneb" in any context, or asks about Vega/Vega-Lite specs in Power BI, Deneb cross-filtering, Deneb interactivity, pbiColor theme integration, Deneb field name escaping, or Deneb rendering issues.
Design, enforce, audit, and validate Power BI report themes. This skill MUST be invoked when a report uses the default or built-in theme, has a minimal custom theme (few or no visualStyles), or has accumulated many visual-level formatting overrides (objects/visualContainerObjects in visual.json); these are signs the theme needs attention. Also automatically invoke when the user asks to "create a theme", "design a theme", "enforce theme compliance", "audit theme adherence", "push formatting to theme", "clear visual overrides", "standardize report formatting", "update theme colors", "change theme typography", "set theme text classes", "validate a theme", "add visual-type overrides to the theme", "copy a theme", "download a theme", "apply a template", or mentions theme design, enforcement, compliance, or visual formatting inconsistency.