Skip to main content
Glama

add_visual_calculation

Add or update an in-visual DAX calculation (e.g., running sum, moving average) to a Power BI visual, rendering it as a Values column without creating a model measure.

Instructions

Author a VISUAL CALCULATION on a visual: an in-visual DAX expression over the visual's own result matrix (e.g. RUNNINGSUM([Sales]), MOVINGAVERAGE([Sales],3), PERCENTOFTOTAL([Sales])) - distinct from a model measure. Written to singleVisual.visualCalculations[] and projected as a Values column so it renders. Re-adding the same name updates it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesthe calculation name (becomes a column)
pageYespage name or displayName
visualYesvisual name (from list_visuals)
daxExpressionYesthe visual-calculation DAX expression
reportSessionIdYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses the write target (singleVisual.visualCalculations[]), the rendering side effect (projected as a Values column), and the upsert behavior (re-adding same name updates it). This is substantive behavioral context, though it omits error handling or permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three compact sentences, each earning its place. Key information is front-loaded, examples are illustrative yet terse, and the behavioral note about updating is efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter tool with no output schema and no annotations, the description covers the core behavior, storage, and update semantics. It could mention prerequisites like the visual needing an existing data matrix, but it is strong overall.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 80%, so baseline is 3. The description adds value by providing DAX expression examples and explaining that the name becomes a column and updates on re-add, enriching the parameter semantics beyond the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Author a VISUAL CALCULATION on a visual', a specific verb-resource pair, and clearly distinguishes it from a model measure. Examples like RUNNINGSUM, MOVINGAVERAGE, and PERCENTOFTOTAL make the scope unmistakable, differentiating it from sibling tools such as add_measure.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly states this is for in-visual DAX expressions over the visual's own result matrix and explicitly says it is 'distinct from a model measure', providing an exclusion. It does not name alternative tools, but the context and examples imply the appropriate use case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyphonica/powerbi-pbix-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server