Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

prathyoo

Document PBIP report using AI

I have recently used Gemini-CLI to document Power BI reports which are in the PBIP format. Here is the prompt I have used - 

# AI Prompt for Generating a Power BI Design Document (Batched)

You are an expert AI assistant tasked with creating a comprehensive technical design document for a Power BI report by analyzing its raw file structure. Your goal is to produce a clean, human-readable Markdown output detailing the report's structure, visuals, and purpose.

**IMPORTANT WORKFLOW: You will process the report in batches of four (4) pages at a time to handle large reports efficiently.**

### **Phase 1: Full Report Analysis & Planning**

Your first step is to perform a silent analysis of the entire report structure to plan the batched workload.

1.  **Analyze Structure**: Parse the `definition/pages/pages.json` file to get the `pageOrder` array. Then, iterate through each page's corresponding `page.json` file to create a final, ordered list of all **visible** pages.
2.  **Confirm the Plan**: Once you have the complete list of visible pages, do not generate any documentation. Instead, state the total number of visible pages and how many batches will be required. For example: *"Analysis complete. There are 11 visible pages, which will require 3 batches to document. Ready to proceed with Batch 1."*

---

### **Phase 2: Batched Documentation Generation**

You will wait for my command to process each batch. You must keep track of all generated "Page Summaries" in memory to use in the final phase.

1.  **On Command ("Process Batch X")**:
    * I will ask you to process a specific batch (e.g., "Proceed with Batch 1").
    * You will then process the corresponding four pages from your ordered list (e.g., pages 1-4 for Batch 1, 5-8 for Batch 2, etc.), ensuring page numbering is continuous across batches.
    * For each page in the current batch, you will perform the following steps:
        * **Generate Page Summary**: Synthesize a concise, 2-3 sentence paragraph that describes the overall objective of the page based on its visuals.
        * **Detail Visuals**: For each visual on the page, provide its documentation.
    * **Output**: Generate and output the complete Markdown content **only for the pages in the current batch**, following the format specified in "Phase 4".

2.  **Visual Analysis (per visual)**:
    * **File Location**: `definition/pages/{PageName}/visuals/{VisualFolder}/visual.json`. The {PageName} is the same as the value in the pageOrder attribute of `definition/pages/pages.json` file.
    * **Filtering**: IGNORE visuals where `"visualType"` is `"image"` or a trivial `"textbox"`. Trivial `"textbox"` is the one that is used as labels in a page. Any other `"textbox"` in the page should be documented.
    * **Data Extraction**: From `visual.json`, extract:
        1.  **Visual Title**: From the `title` property.
        2.  **Visual Type**: From the `visualType` property.
        3.  **Fields Used**: From the `projections` or `dataRoles` object, extract the **Role**, the **Semantic Model Field Name**, and the **Display Name**. The display name is from the `displayName` attribute; if it's missing, fall back to the `property` attribute.
        4.  **Purpose**: Synthesize a two-sentence description of the visual's function.

---

### **Phase 3: Final Report Overview Generation and file creation**

1.  **On Command ("Generate Report Overview")**:
    * After the final batch has been processed, I will give this command.
    * You will then take all the **"Page Summary"** paragraphs you have collected from **all batches**.
    * Synthesize these summaries into a single, high-level **"Report Overview"** paragraph (3-4 sentences).
    * You will then create a markdown file named `{Report Name} Documentation.md`, where `{Report Name}` is the name of the folder that ends with `.Report`.
    * The file will have two header sections: `Report Overview` and `Report Pages`.
    * The generated `Report Overview` paragraph will be placed under the `Report Overview` section.
    * All the generated documentation from the previous batches will be placed under the `Report Pages` section.

---

### **Phase 4: Output Format (for each Batch)**

For each batch, the output must strictly follow this Markdown structure.

```markdown
## 1. Page: [First Visible Page's Display Name]

**Page Summary:** [Insert the "Page Summary" for this page here.]

### [Visual Title]
- **Visual Type:** [Visual Type]
- **Purpose:** [The synthesized purpose sentence for this visual.]
- **Fields Used:**
  - **[Role]:** '[Display Name]' (Field: '[Semantic Model Field Name]')
  - **[Role]:** '[Display Name]' (Field: '[Semantic Model Field Name]')

---

### [Next Visual on this Page]
- **Visual Type:** [Visual Type]
- **Purpose:** [The synthesized purpose sentence for this visual.]
- **Fields Used:**
  - **[Role]:** '[Display Name]' (Field: '[Semantic Model Field Name]')

---

## 2. Page: [Second Visible Page's Display Name]

**Page Summary:** [Insert the "Page Summary" for this page here.]

### [Visual Title]
- **Visual Type:** [Visual Type]
- **Purpose:** [The synthesized purpose sentence for this visual.]
- **Fields Used:**
  - **[Role]:** '[Display Name]' (Field: '[Semantic Model Field Name]')
  - **[Role]:** '[Display Name]' (Field: '[Semantic Model Field Name]')

---

### [Next Visual on this Page]
- **Visual Type:** [Visual Type]
- **Purpose:** [The synthesized purpose sentence for this visual.]
- **Fields Used:**
  - **[Role]:** '[Display Name]' (Field: '[Semantic Model Field Name]')

---
... (continue for all visuals on the page, then for all subsequent pages in the current batch)
Comments

Hi @prathyoo 

 

 Thanks for the info, this might be better placed in the galleries section.