Taking over an existing Power BI project isn't just about understanding how it works. It's about understanding why it works that way. Making changes without that context can introduce problems elsewhere.
Using a fictional retailer's Power BI project and three development challenges, I want to explore how much responsibility I can delegate to Claude Code, when I need to step in, and whether I can confidently approve its work without doing it again. So, what does the working environment look like?
In this blog
- Giving Claude Code more than just project access
- A slow matrix. Can AI fix it without breaking the numbers?
- One target changes. What else could break?
- Can AI catch the mistakes we forget to check?
- How much development work would I actually hand over?
Connecting Claude Code to the Power BI project
I'm starting with a development copy of the retailer's PBIP project, tracked in Git. I want Claude Code to work against the existing implementation rather than build something in isolation. Every change needs to be traceable, reviewable, and reversible.
For these assignments, I'm bringing together several components, each serving a different purpose:
Access to the existing semantic model and report definitions.
Power BI-specific guidance and conventions for working with project files.
Model inspection, dependency investigation, DAX execution, and targeted model changes.
Working with report definitions and interacting with the Power BI Desktop environment.
Change tracking, review, and automated execution of recurring development checks.
The first two assignments run interactively against my local development environment. The third runs automatically through GitHub Actions, using repository contents and reusable review instructions without requiring an open Power BI Desktop session.
Each assignment starts from a separate branch of the same baseline project, ensuring that changes introduced during one experiment don't influence the others. I'm also keeping Power BI Desktop and DAX Studio available for independent validation and detailed performance diagnostics.
With the environment established, let's start with a problem that has gradually developed in our retailer's profitability report.
Finding and fixing the slow matrix
The retailer's regional profitability report includes a matrix that allows sales managers to expand individual regions and review customer-level performance. While regional reporting works reasonably well, expanding larger regions or changing reporting periods at customer level introduces a noticeable delay.
The matrix has evolved over time, incorporating customer rankings, previous-year comparisons, and profitability growth. None of these requirements can simply be removed to improve performance. I've designed the sample model to reproduce this problem.
| Region / Customer | Net Sales | Profit | Profit LY | Growth % | Rank |
|---|---|---|---|---|---|
| North | €4,820,000 | €720,000 | €665,000 | 8.3% | |
| Customer A | €310,000 | €54,000 | €48,000 | 12.5% | 1 |
| Customer B | €285,000 | €48,000 | €45,000 | 6.7% | 2 |
| Customer C | €260,000 | €48,000 | €42,000 | 14.3% | 2 |
| Customer D | €240,000 | €39,000 | €41,000 | −4.9% | 3 |
| Customer E | €120,000 | €0 | €8,000 | −100% | 4 |
| Customer F | €95,000 | −€5,000 | €2,000 | −350% | 5 |
| … | … | … | … | … | … |
| South | €3,950,000 | €610,000 | €580,000 | 5.2% | |
| West | €3,420,000 | €490,000 | €470,000 | 4.3% |
Experiment note: The three assignments use a simulated Power BI development scenario. The investigation findings, performance measurements and validation outcomes are illustrative rather than results from actual executions.
Establishing the context
Before handing over the assignment, I've established the model characteristics and business rules that any optimisation must preserve.
The assignment
I have a few suspects, but I deliberately leave them out of the assignment.
Following the investigation
I provide Claude Code with the visual query captured through Performance Analyzer, giving it a reproducible starting point.
EVALUATE
SUMMARIZECOLUMNS(
Customer[Region],
Customer[Customer Name],
TREATAS({2026}, 'Date'[Year]),
TREATAS({"North"}, Customer[Region]),
"Net Sales", [Net Sales],
"Profit", [Profit],
"Profit LY", [Profit LY],
"Profit Growth %", [Profit Growth %],
"Customer Rank", [Customer Profit Rank]
)
Simplified representation of the visual query.
With approximately 91% of query execution time attributed to the Formula Engine, the investigation focuses on calculation overhead. Individual calculations are isolated while preserving comparable filter context and customer populations.
Each diagnostic variation is compared independently against the original query.
The finding: The diagnostic results point towards customer profitability ranking as the primary bottleneck, rather than the volume of sales transactions.
From diagnosis to implementation
The existing ranking measure repeatedly evaluates customer eligibility and profitability across the selected customer population.
Existing implementation
Customer Profit Rank =
VAR CurrentProfit =
[Profit]
VAR EligibleCustomers =
FILTER(
ALLSELECTED(Customer[Customer Name]),
CALCULATE(COUNTROWS('Fact Sales')) > 0
&& NOT ISBLANK([Profit])
)
RETURN
IF(
ISINSCOPE(Customer[Customer Name])
&& HASONEVALUE(Customer[Region])
&& COUNTROWS('Fact Sales') > 0
&& NOT ISBLANK(CurrentProfit),
RANKX(
EligibleCustomers,
[Profit],
CurrentProfit,
DESC,
DENSE
)
)
Before approving the proposed change, I establish a minimum performance improvement target of 40%, without compromising business behaviour.
Proposed implementation
Customer Profit Rank =
VAR EligibleCustomers =
FILTER(
ALLSELECTED(
Customer[Region],
Customer[Customer Name]
),
CALCULATE(COUNTROWS('Fact Sales')) > 0
&& NOT ISBLANK([Profit])
)
RETURN
IF(
ISINSCOPE(Customer[Customer Name])
&& HASONEVALUE(Customer[Region])
&& COUNTROWS('Fact Sales') > 0
&& NOT ISBLANK([Profit]),
RANK(
DENSE,
EligibleCustomers,
ORDERBY([Profit], DESC),
DEFAULT,
PARTITIONBY(Customer[Region]),
MATCHBY(Customer[Customer Name])
)
)
The important change isn't simply replacing RANKX with RANK. It's expressing the ranking operation through an explicit population, ordering, regional partition, and customer identity.
Testing beyond the obvious
A faster query is only useful if the calculation continues to behave as expected. I've defined a controlled ranking scenario independently of the proposed implementation.
| Input data | Expected results | ||
|---|---|---|---|
| Customer | Profit | Full region rank | Selected customers rank |
| Customer A | €54,000 | 1 | Not selected |
| Customer B | €48,000 | 2 | 1 |
| Customer C | €48,000 | 2 | 1 |
| Customer D | €39,000 | 3 | 2 |
| Customer E | €0 | 4 | 3 |
| Customer F | −€5,000 | 5 | 4 |
| Customer G | No sales | Not ranked | Not ranked |
Comparing the original and revised calculations tests equivalence. Comparing them against independently defined results tests whether they meet the business requirements.
| Regression scenario | Result | Regression scenario | Result |
|---|---|---|---|
| Full region ranking | Pass | Customers with undefined profit | Pass |
| Selected customers | Pass | Multiple regions | Pass |
| Tied profits | Pass | Regional and grand totals | Pass |
| Zero and negative profits | Pass | Product filters | Pass |
| Customers without sales | Pass | Reporting period changes | Pass |
Can I sign off?
The final comparison uses the original visual query under comparable execution conditions.
| Performance metric | Original | Optimised | Reduction |
|---|---|---|---|
| Formula Engine | 7,680 ms | 1,980 ms | 74.2% |
| Storage Engine | 740 ms | 700 ms | 5.4% |
| Visual display duration | 380 ms | 370 ms | 2.6% |
| Returned customer rows | 3,184 | 3,184 | Unchanged |
| Minimum 40% performance improvement | 68.2% |
|---|---|
| Calculation regression | Zero mismatches |
| Business behaviour | 10 of 10 scenarios |
| Implementation scope | One measure modified |
| Review effort | No repeated investigation |
My assessment
What I found particularly useful was the investigation sequence rather than the rewritten DAX. I provided the original query and assisted with capturing execution traces, but the diagnostic comparisons and regression checks gave me a clear path to reviewing the change.
I'd still run an independent validation query before approving it. That's a reasonable part of my review. Having to reconstruct the entire performance investigation isn't. Can Claude Code provide the same level of confidence when a change spans both the semantic model and the report?
Changing the target without rewriting history
Midway through 2026, the retailer revises its annual sales plan. Regional sales managers need to track performance against the revised targets, while monthly performance reviews must continue to reflect the targets originally agreed upon.
The existing target measure is already used in KPI cards, variance calculations, conditional formatting, reference lines, and report tooltips. The challenge isn't introducing a revised target. It's ensuring that the change doesn't unintentionally affect historical reporting.
Establishing the context
I've established the following assumptions about how the retailer maintains its sales targets and reporting history.
- Target granularity
- Month and sales region
- Target availability
- Original and revised targets available in the source data
- Target coverage
- Both versions cover the applicable reporting period
- Filter context
- Shared date and region dimensions
- Semantic model
- Shared by current and archived reporting pages
- Actual sales
- Same calculation across both reporting experiences
- Investigation scope
- Model and report dependencies within the sample PBIP project
The requirement is to preserve the original target definition, not to create a frozen snapshot of historical sales.
The assignment
Following the less obvious dependencies
The existing implementation contains a chain of dependent calculations.
Existing target
Sales Target =
SUM('Fact Target'[Original Target])
Existing variance
Sales Variance % =
DIVIDE(
[Net Sales] - [Sales Target],
[Sales Target]
)
Existing performance classification
Sales Target Status =
SWITCH(
TRUE(),
ISBLANK([Sales Variance %]), BLANK(),
[Sales Variance %] >= 0, "On Target",
[Sales Variance %] >= -0.05, "At Risk",
"Below Target"
)
Changing the base measure would affect every dependent calculation. However, model dependencies only reveal part of the problem. Both reporting experiences also use a shared tooltip page, which I've deliberately left out of the assignment.
The finding: Updating the existing target measure would affect both reporting experiences. The shared tooltip introduces an additional dependency that cannot be resolved by changing the current page's visual bindings alone.
Separating the two reporting experiences
Claude Code's proposed implementation retains the existing measures for archived reporting and introduces an explicit set of revised calculations for current reporting.
Revised target
Sales Target Revised =
SUM('Fact Target'[Revised Target])
Revised variance
Sales Variance Revised % =
DIVIDE(
[Net Sales] - [Sales Target Revised],
[Sales Target Revised]
)
Revised performance classification
Sales Target Status Revised =
SWITCH(
TRUE(),
ISBLANK([Sales Variance Revised %]), BLANK(),
[Sales Variance Revised %] >= 0, "On Target",
[Sales Variance Revised %] >= -0.05, "At Risk",
"Below Target"
)
For this limited change, I prefer explicit measures over introducing a broader target-version architecture. The current pages are rebound to the revised calculations, while archived pages retain their existing references.
Catching a partially correct implementation
I've selected a validation month where the revised target changes both the variance and performance classification.
The initial implementation produces the correct headline KPIs, but the current page's tooltip still displays the original target and variance. The report-level validation exposes the inconsistency.
| Validation check | First implementation | After correction |
|---|---|---|
| Current target card | Pass | Pass |
| Current variance | Pass | Pass |
| Conditional formatting | Pass | Pass |
| Chart reference line | Pass | Pass |
| Current page tooltip | Fail | Pass |
| Archived reporting | Pass | Pass |
| Validation summary | 5/6 passed | 6/6 passed |
Claude Code identifies the shared tooltip binding during validation and introduces a dedicated tooltip for current reporting, preserving the original for archived pages.
Can I sign off?
The simulated regression suite covers six validation checks across four month-region combinations.
My assessment
What mattered here wasn't that Claude Code got every change right on its first attempt. It was that the validation exposed an incomplete implementation before approval. The dependency mapping gave me a structured way to review both reporting experiences without manually inspecting every visual or reconstructing the investigation.
But what if Claude Code could identify a maintenance issue before I even asked it to investigate?
Automating the checks developers tend to forget
The retailer has started accounting for customer returns in its Net Sales calculation. The developer updates the measure, but its description still explains the previous business definition.
The calculation may be correct, and the report may pass validation, yet the semantic model now contains misleading documentation. Rather than adding another item to the developer's review checklist, I want to give Claude Code a recurring development responsibility.
Establishing the context
Setting up the automation
Unlike the previous assignments, I don't want to initiate this investigation manually. The review should become part of the existing pull request workflow.
I'd maintain the review instructions alongside the project, separating them from the workflow configuration.
The workflow explicitly loads the review instructions, retrieves the relevant repository context, and publishes its findings against the pull request.
The instructions are defined once and reused across subsequent pull requests.
Detecting a change in meaning
The first pull request contains the following measure change.
Original definition
Net Sales =
SUM('Fact Sales'[Sales Amount])
- SUM('Fact Sales'[Discount Amount])
Revised definition
Net Sales =
SUM('Fact Sales'[Sales Amount])
- SUM('Fact Sales'[Discount Amount])
- SUM('Fact Sales'[Return Amount])
The measure name hasn't changed, and its description isn't missing. Detecting the issue requires understanding what has changed in the calculation.
Testing the automation beyond a single pull request
Detecting one inconsistency isn't enough. I want to establish whether the review can distinguish meaningful changes from routine development activity.
| Test scenario | Expected | Reported | Outcome |
|---|---|---|---|
| Business logic changed, description unchanged | 1 | 1 | Pass |
| DAX refactored, meaning unchanged | 0 | 0 | Pass |
| Business logic and description correctly updated | 0 | 0 | Pass |
| Previously identified inconsistency corrected | 0 | 0 | Pass |
For the refactoring scenario, I've used an equivalent implementation that introduces variables without changing the calculation.
Net Sales =
VAR GrossSales =
SUM('Fact Sales'[Sales Amount])
VAR Discounts =
SUM('Fact Sales'[Discount Amount])
RETURN
GrossSales - Discounts
After the developer corrects the outdated description in the first pull request, another commit triggers the review. The workflow updates its summary to confirm that the previously reported inconsistency is no longer present.
Can I leave it running?
I'm evaluating whether this is a responsibility I can delegate repeatedly without creating another process that requires constant attention.
My assessment
What appeals to me here is the recurring value rather than the complexity of the task. Once configured, the review requires no additional prompting and provides findings directly within the development workflow. I'd retain it as an advisory check, gathering more evidence about its reliability before considering stricter release controls.
Across these three assignments, what would I change about my development environment before making Claude Code a regular part of it?
What I'd use again and what I'd change first
The three assignments highlight different development challenges, but they share a common dependency: the quality of context available to Claude Code.
A reproducible visual query makes performance investigation more reliable. Visibility of downstream dependencies helps establish the scope of a change. Approved business definitions make contextual reviews possible.
These aren't exclusively AI requirements. They're development practices I'd want to strengthen regardless of which tools my team uses.
Giving AI more than project access
Before introducing Claude Code across multiple Power BI projects, I'd establish four complementary sources of context.
I'd use CLAUDE.md as an entry point, defining where information lives, how to retrieve it, and which sources are authoritative. For instance, the semantic model can reveal which measures depend on Sales Target. The product inventory can identify other reports consuming that model, while business documentation explains why certain historical definitions must remain unchanged.
Standardising without duplicating
I wouldn't maintain a separate copy of every business definition or product dependency inside each repository. I'd separate project-specific knowledge from information shared across the BI environment.
Making the next assignment easier
I'd also expect each completed assignment to improve the development environment for the next one.
I'd rather delegate a technically difficult assignment with clear acceptance criteria than a simple change whose consequences are difficult to establish. That's where I'd invest before expanding Claude Code's responsibilities. Otherwise, we're scaling our ability to make changes without scaling our ability to understand and approve them.
Closing Thoughts
If I were introducing Claude Code into my everyday Power BI development workflow, I'd start with maintenance rather than building something new. There is already enough complexity in investigating performance issues, managing changes, and keeping existing implementations reliable.
I'd keep assignments that require architectural judgment interactive and gradually automate the checks where expectations are well understood. The more confidence I build in the process, the more responsibility I'd be comfortable delegating.
Ultimately, I wouldn't measure the value of Claude Code by how much development work it completes. I'd measure it by how much of that work I can confidently approve without having to do it again.
Comments
Join the discussion below (GitHub login required), or share your thoughts on LinkedIn . I’m most active there.