Skip to content
AI in practice2 min read

ChatGPT or Claude wrote the DAX. How do you check it?

A formula can run successfully and still answer the wrong question. Use small test data to verify an AI-assisted measure, its filters and its grand total.

The DataStudio team
DataStudio diagram for: ChatGPT or Claude wrote the DAX. How do you check it?
DataStudio diagram for: ChatGPT or Claude wrote the DAX. How do you check it?

Define the rule before asking for code

Do not ask only for “a margin measure.” Describe the tables, columns, relationships and business rule. Do you need overall margin or the average of product percentages? How are returns handled? What should happen when revenue is zero?

You can ask ChatGPT or Claude for a draft and a list of assumptions. Use invented data or material permitted by company policy. Do not assume either product automatically has access to your Power BI model.

Use a small example to catch a large mistake

In an invented table, product A has revenue of 100 and profit of 20; product B has revenue of 900 and profit of 90. Their margins are 20% and 10%, but overall margin is not 15%. It is (20 + 90) ÷ (100 + 900) = 11%.

A result of 15% probably means the formula averages percentages. Two explicit rows make a clearer test than scanning a large dashboard. These values do not describe any real company.

Ask for a test plan as well

A useful request is: “Create five test cases for this rule. Show the inputs, expected result and explanation for each. Do not claim you executed the code unless you did.”

Then test one product, multiple products, the grand total, zero revenue and a return. Agreement between two AI tools is not independent validation. Calculate the expected answer separately on a small example and test the measure in the actual model.

Keep the verified version

Save the formula, business definition, test cases and verification date. If a relationship or source structure changes, a previously passing test does not automatically validate the new model.

OpenAI’s guidance recommends checking important numbers and assumptions before using results, while Anthropic’s coding guidance emphasizes verification. When discussing an AI-assisted calculation with DataStudio, bring the expected answer as well as the formula.

Put this into practice with your data

Tell us which reports you use and what you would like to improve. We will work out where to start together.

Tell us about your task
Back to the blog

Tell us what you need

We will get back to you and agree the first step together. Price and timing follow the task.