Skip to main content

We Asked an AI Agent to Build Tetris in Power BI. It was playable 11 minutes later.

Discover how an AI coding agent built a playable Power BI custom visual in 11 minutes, and what agent-assisted development means for business reporting.

Written By
Hemanth Kotha Hemanth Kotha
Published On
Read Time 14 min read
A Power BI bar chart built from falling Tetris blocks with the build's figures

Developing custom visuals in Power BI has traditionally required specialist skills, multiple development tools and extensive testing. Even relatively simple requirements can involve significant development time, particularly when businesses need functionality beyond Power BI’s standard reporting capabilities.

But what happens when an AI coding agent takes on that development process?

We put this to the test using Claude Code, an AI coding agent capable of writing, testing and refining software. The challenge was deliberately unconventional: build a fully playable Tetris-style game inside Power BI Desktop.

Our entire instruction was one sentence, typos included:

“Can you create a new power bi file with tetrix game can you do that with scores and all ?”

Approximately 11 minutes later, we had a working game inside Power BI, complete with scoring, levels, sound effects and a leaderboard. No one on our team had written a single line of code.

While building a game isn’t a typical business intelligence requirement, the experiment demonstrated something far more relevant: how AI coding agents can accelerate Power BI development, automate technical tasks and make complex customisations more accessible.

In this article, we break down how the agent built the game, the technologies that made it possible and what this approach could mean for businesses developing Power BI reports and custom visualisations. We also explore the limitations and why human expertise remains essential when developing reliable, enterprise-ready reporting solutions.

Key takeaways

  • AI agents can significantly accelerate Power BI development. Tools such as Claude Code, GitHub Copilot and Codex can help generate, modify and test Power BI reports and custom visuals through natural language instructions.
  • New development tools make this possible. Power BI Project (PBIP) files, agent skills and the Power BI Desktop Bridge allow AI agents to work directly with report definitions, validate changes and review results inside Power BI Desktop.
  • Our experiment produced a playable custom visual in approximately 11 minutes. While the results won’t translate directly to every business application, they demonstrate the potential to reduce repetitive development work and accelerate prototyping.
  • Human expertise remains essential. AI can assist with technical implementation, but data accuracy, business requirements, governance and production readiness still require professional oversight.

Why custom visuals used to take weeks

Building a custom Power BI visual involves several stages, each with its own technical requirements. While none is necessarily difficult in isolation, together they can turn a more complex idea into a multi-week development project.

  • Toolchain setup. Node.js, the Power BI visuals tools, certificates and a dev server, before you write a single line.
  • A niche API. Capabilities, data view mappings, the formatting pane model and the visual host services all have their own rules.
  • A slow feedback loop. Write code, package, import into Desktop, click around, find a bug, repeat.
  • Polish that eats days. Keyboard support, contrast, screen readers, edge cases and performance.

For most reporting requirements, Power BI’s standard visuals are more than capable. But when businesses need specialised visualisations, bespoke interactions or functionality beyond the built-in options, custom development can introduce significant additional time, cost and complexity.

As a result, potentially valuable reporting features may be deprioritised or abandoned simply because the development effort is difficult to justify.

What changed: three ingredients

The breakthrough isn’t simply that AI can write code. It’s that AI coding agents can now work directly with Power BI project files, follow specialised development guidance and validate their output inside Power BI Desktop.

Three developments make this possible.

1. Reports are now code

With the Power BI Project (PBIP) format, reports can be stored as JSON files using the Power BI enhanced report format (PBIR), while semantic models are defined in plain-text Tabular Model Definition Language (TMDL).

Rather than relying entirely on manual changes within Power BI Desktop, an AI coding agent can read, generate and modify these files directly, much like it would when working with Python or TypeScript. This gives agents access to the underlying structure of reports and data models, opening up new possibilities for automating development tasks.

2. Skills give the agent Power BI judgement

Skills are packaged instructions and reference material that an AI agent loads when a task requires specialised knowledge. We used Power BI skills for report design and report authoring. They cover layout grids, chart selection, colour contrast, visual JSON schemas and validation rules.

Instead of guessing what a visual.json file should look like, the agent can refer to the relevant specifications and development conventions. This helps it generate more consistent output, follow established Power BI practices and identify potential problems before testing.

3. The Desktop Bridge closes the loop

This is the big one.

Microsoft’s Power BI Desktop Bridge allows AI coding agents to interact with Power BI Desktop itself. Using the Desktop Bridge CLI (@microsoft/powerbi-desktop-bridge-cli), an agent can open a project, reload it after making changes and capture screenshots of report pages.

The accompanying Power BI report authoring CLI (@microsoft/powerbi-report-authoring-cli) provides validation and report authoring capabilities. Together, these tools enable something particularly important: a feedback loop.

The agent can write the files, validate their structure, reload the report in Power BI Desktop, inspect the rendered result and make corrections where necessary. Rather than simply producing code and leaving a developer to test whether it works, the agent can participate in the testing and refinement process itself.

For Power BI developers, this has the potential to significantly reduce the time spent moving between writing code, testing changes and resolving errors, making it faster to move from an initial idea to a working prototype.

Diagram of the agent loop: plan and design, write files, validate with powerbi-report-author, reload and screenshot with powerbi-desktop, then repeat until it renders right. Three ingredients listed: reports as code, skills, and the Desktop Bridge plus CLIs.

The 11-minute build, step by step

From the initial project setup to a playable game inside Power BI Desktop, the entire build took approximately 11 minutes.

What makes this particularly interesting isn’t just that the agent generated a working game. It also created a Power BI-compatible custom visual, connected it to a semantic model, tested the functionality and assembled the finished report.

Timeline of the build from file timestamps: 15:39 scaffold the visual project, 15:41 game engine and sound, 15:43 styles and controls, 15:45 self-playing headless test, 15:46 package the 11 KB pbiviz, 15:47 build the semantic model, 15:50 report page opened and screenshotted in Power BI Desktop.

In those 11 minutes the agent:

  1. Scaffolded the project. Created a custom visual project using the official Power BI visuals tools.
  2. Built the game engine. Implemented a 7-bag randomiser, wall kicks, hold and ghost pieces, combos, back-to-back bonuses and levels.
  3. Generated sound effects. Created retro sound effects dynamically in the browser, muted by default.
  4. Added user controls and accessibility features. Implemented keyboard and on-screen button controls, alongside screen-reader announcements.
  5. Created persistent scoring. Saved a top-5 leaderboard using the Power BI local storage API.
  6. Tested and packaged the visual. Ran a headless test that simulated the game playing itself, checking its functionality before packaging the custom visual.
  7. Integrated it with Power BI. Built a semantic model with a “Start level” slicer, allowing a report selection to control the game’s starting level.
  8. Generated and reviewed the report. Created the report page, opened it in Power BI Desktop and inspected the rendered output through a screenshot.

The result was more than a standalone game. It was a functioning Power BI custom visual, complete with its own logic, user interactions and integration with the report’s semantic model.

Animated gameplay of the Tetromino Drop custom visual: pieces fall and lock, lines clear, and the score, combo counter and level go up.
The Tetromino Drop report page in Power BI Desktop: how-to-play and scoring panels on the left, the game board in the middle, and a start level slicer from 1 to 10 on the right.

By the numbers

WhatResult
Scaffold to running in Power BI DesktopAbout 11 minutes (under 15 including planning)
Agent working contextAbout 50K tokens
TypeScript written832 lines in 3 files
Packaged custom visual (.pbiviz)11 KB
Report1 page, 7 visuals, 1 calculated table
Lines of code typed by a person0

The most significant result isn’t the amount of code generated, but the fact that the agent was able to move through the development, testing and integration stages with no manually written code.

Under the hood: how a PBIP stores a custom visual

One of the more interesting challenges was getting the newly generated custom visual into Power BI Desktop without manually importing it. The Power BI Project (PBIP) format made this possible by exposing the report’s underlying file structure, allowing the agent to work directly with the files responsible for registering and displaying custom visuals.

A custom visual is normally packaged as a .pbiviz file, which is essentially a ZIP archive. In our project, the custom visual’s package information and resources were represented as files within the PBIP structure. This allowed the agent to register the visual it had just created and add it directly to the report.

Folder tree of a Power BI Project with a custom visual. Four files matter: package.json, the package manifest; the pbiviz.json resource holding the compiled code and capabilities; report.json, which registers the package; and visual.json, which places the visual on a page and binds its data.

Four text files carry a custom visual inside a PBIP. These come from the real Tetris project.

FileWhat it holds
CustomVisuals/<guid>/package.jsonThe package manifest: name, version, author, the visual's GUID and a pointer to the resource file.
CustomVisuals/<guid>/resources/<guid>.pbiviz.jsonThe visual itself: API version, capabilities (its data roles and formatting options), and the compiled JavaScript, CSS and icon stored as text. For Tetris the whole game is about 21 KB of JavaScript.
definition/report.jsonRegisters the package under resourcePackages with the type CustomVisual, so Desktop knows to load it.
definition/pages/…/visuals/…/visual.jsonPuts the visual on a page. Its visualType is the GUID, and its data bindings use the role names from the visual's capabilities. Here, the startLevel role is bound to a measure in the semantic model.

Three things we learned the hard way:

  • Getting the visual to work wasn’t entirely straightforward. During development, we encountered three issues that weren’t clearly covered in the documentation we were working from:

    • Two manifests, two places. The outer package manifest goes in package.json, while the full visual manifest belongs in the resources folder. Swap them and Desktop fails with the error "Could not find member 'apiVersion'".
    • Reload isn’t enough. In our test, Desktop registered the new private visual only when the project was opened or the file was imported. Until then, the visual appeared as an empty box without displaying an error.
    • The GUID ties everything together. The folder name, the report.json entry and every relevant visual.json must reference the same GUID for the visual to be recognised correctly.

    These were small but important implementation details. Once the agent identified and corrected them, it was able to complete the integration and render the custom visual inside Power BI Desktop.

Why this matters beyond the experiment

There is a broader benefit to working with Power BI projects as files.

When custom visual definitions and report files are managed through source control, developers can track changes, review modifications through pull requests and revert to earlier versions when needed.

For organisations managing more complex Power BI environments, this can support a more consistent and auditable development process, particularly when multiple developers are working on the same reporting solution.

Combined with AI-assisted development, it creates opportunities not only to accelerate initial development, but also to streamline how changes are made, reviewed and maintained over time.

The old way vs. agent-assisted

The Tetris experiment demonstrated how quickly an AI coding agent could take a custom visual from an initial instruction to a working prototype.

But the potential applications extend beyond custom visuals. Based on our experience developing Power BI solutions, agent-assisted workflows could reduce the time spent on several common development tasks.

TaskTraditional DevelopmentAgent Assisted Development
Custom visual from scratchCan take weeks for complex requirementsPotentially minutes to hours for initial prototypes
New report page from a briefOften days, depending on requirementsInitial layouts and report structures can be generated much faster
Brand theme across every pageManual configuration and testing across pagesTheme and formatting changes can be generated programmatically
Accessibility passRequires dedicated testing and validationAgents can assist with initial checks, with manual verification still required
DocumentationOften produced separately from developmentAgents can generate draft documentation alongside the build

These comparisons illustrate potential workflow improvements based on our development experience. Actual time savings depend on project complexity, data quality, technical requirements and the level of review needed.

What still needs a person

The agent was fast, but it wasn’t flawless.

During the same session, its first custom visual package used a structure that Power BI Desktop rejected. Rather than stopping, the agent inspected the error, compared its output with a package that Desktop had successfully imported and corrected the format.

This ability to identify and resolve implementation errors is one of the more interesting aspects of agent-assisted development. But there’s an important distinction between producing a working prototype and delivering a production-ready Power BI solution.

An AI agent can generate code, create report structures and automate parts of the testing process. It cannot independently guarantee that the resulting solution is accurate, secure, performant or appropriate for the organisation using it. Those responsibilities still require human oversight.

For enterprise Power BI development, several questions remain essential:

  • Data accuracy. Are the underlying data models, calculations and measures correct? Can the results be trusted to support business decisions?
  • Business requirements. Does the report answer the questions users actually need answered, or does it simply present data in an appealing format?
  • Security and governance. Are data access permissions, organisational policies and custom visual approvals being respected?
  • Performance and scalability. Will the solution continue to perform effectively with larger datasets, more users and changing requirements?
  • Accessibility and usability. Can the intended audience use the report effectively, including people relying on assistive technologies?
  • Maintainability. Can the solution be understood, updated and supported after the initial build?

The Tetris experiment demonstrates how AI agents can accelerate technical implementation. It doesn’t remove the need for experienced developers, analysts and business stakeholders to define requirements, validate the output and make informed decisions. Agents can make the build much faster. They don’t replace judgement.

Try it yourself: three prompts to steal

You’ll need Power BI Desktop with Power BI Project (PBIP) files, the Desktop Bridge preview turned on, Node.js, an AI coding agent and the two Power BI CLIs mentioned above. Then try:

Prompt 1: plan first. “Look at my semantic model and propose a three-page executive report. Show me a design brief before you build anything.”

Prompt 2: the visual you always wanted. “Build a custom Power BI visual that shows [your KPI] as a [gauge, timeline or animated race]. Package it as a .pbiviz and add it to page 1.”

Prompt 3: the safety net. “Review every page of this report for accessibility: contrast, alt text and tab order. Fix what you can and list the rest.”

FAQ

Do I need to be a developer?

Not necessarily. AI coding agents can help users create Power BI reports and custom visuals without writing the underlying code themselves. However, understanding Power BI, data modelling and the requirements of a good reporting solution remains important. For more complex implementations, development expertise is still valuable for validating, troubleshooting and maintaining the finished result.

Is our data sent to the AI?

Potentially, yes. AI coding agents may send project files, code, metadata and other information they access to the model provider as part of processing your instructions. Exactly what is shared depends on the agent, its configuration and the tools it uses.

Before using an agent with business data, review your organisation’s security policies, the provider’s data-handling terms and the permissions granted to the agent. Avoid exposing credentials, confidential information or sensitive datasets unless the environment has been approved for that purpose.

Can we deploy an agent-built custom visual?

Yes, provided the custom visual meets Power BI’s technical requirements and your organisation’s deployment and security policies. An agent-generated .pbiviz package is still a Power BI custom visual and should undergo the same testing, review and approval processes as one developed manually.

Depending on your organisation, this may include administrator approval, security assessment and validation of the visual’s behaviour before wider deployment.

What does it cost?

Costs depend on the AI model, coding agent, subscription or API pricing, and the amount of work performed. Our experiment used approximately 50K tokens of working context, although total billed usage can be higher because agents make multiple model calls throughout a task.

The financial benefit comes from the potential reduction in development effort, particularly for repetitive tasks and early-stage prototyping. Actual savings will depend on the complexity of the project and the amount of testing and refinement required.

Does it work with Microsoft Fabric?

Yes. Power BI project files and Tabular Model Definition Language (TMDL) can support development workflows involving Microsoft Fabric and Git integration. This allows supported report and semantic model changes to be managed through source control, reviewed through pull requests and incorporated into established development processes.

However, individual capabilities and deployment requirements may differ between Power BI Desktop and Fabric environments.

Can AI agents build production-ready Power BI reports?

AI coding agents can assist with many stages of Power BI development, including generating report structures, creating visuals, modifying semantic models and running validation checks. However, a working report isn’t automatically a production-ready solution.

Business-critical reporting still requires verification of data accuracy, security, performance, accessibility and compliance with organisational requirements. AI agents can accelerate development, but the resulting solutions should undergo appropriate technical and business review before deployment.


What this means for the future of Power BI development

Eleven minutes. One prompt. A fully playable custom visual running inside Power BI Desktop. The experiment started with an unconventional idea, but the implications extend well beyond building a game. AI coding agents are changing how developers approach Power BI, making it possible to automate more of the development process, accelerate prototyping and explore custom reporting functionality that might previously have required considerably more time and effort.

The technology doesn’t eliminate the need for experienced developers or sound business judgement. It changes where that expertise can deliver the most value. The question is no longer simply what AI can build, but how organisations can use it to develop better reporting solutions. Want to explore what AI-assisted Power BI development could mean for your business?

Book a 30-minute consultation with Synapx to discuss your reporting requirements and where these new capabilities could make a difference.

Hemanth Kotha

Author

Hemanth Kotha

Power Platform Consultant

Hemanth is a Power Platform consultant at Synapx with a focus on data maturity, digital transformation, and Microsoft Fabric analytics. He writes practical guides on modernising data estates and building business intelligence solutions.

Connect on LinkedIn

Want to Stay Updated?

Subscribe to Synapx Insider, our weekly Data & AI newsletter read by 6k+ subscribers.

Subscribe Now