Skip to main content
Glama

pbi_create_topn_measure

Create a Top-N filter measure in Power BI to display only the top ranked dimension members in a visual, using a base measure and optional rank measure.

Instructions

Create a Top-N filter measure.

DAX template:

IF(RANKX(ALL({dim_table}[{dim_column}]), [{rank_measure}], , DESC) <= {N}, [{base}], BLANK())

Use as the value of a chart visual to surface only the top N members of a dimension. rank_measure defaults to base_measure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYes
tableYes
overwriteNo
base_measureYes
measure_nameNo
rank_measureNo
format_stringNo
display_folderNoTop-N
dimension_tableYes
dimension_columnYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations provided, the description must disclose behavioral traits. It indicates the tool creates a measure with a specific DAX formula but does not mention side effects, destructive actions, authentication needs, or the effect of the 'overwrite' parameter. The description lacks transparency about what happens to existing measures or data.

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

Conciseness4/5

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

The description is concise, using a few sentences and a code block. It is front-loaded with the purpose and provides the DAX template efficiently. No wasted words, though it could be slightly more structured with explicit parameter descriptions.

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

Completeness2/5

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

Given the tool's complexity (10 parameters, 0% schema coverage, no annotations), the description is incomplete. It does not explain the output despite an output schema existing, fails to cover half the parameters, and omits constraints or prerequisites. The agent would need to infer many details.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It explains the roles of base_measure, dimension_table, dimension_column, n, and rank_measure through the DAX template and notes the default for rank_measure. However, it does not explain other parameters like measure_name, format_string, display_folder, overwrite, or table, leaving 5 of 10 parameters undocumented.

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 clearly states the tool creates a Top-N filter measure, provides the DAX template, and specifies its use for a chart visual. This distinguishes it from other measure creation tools like pbi_create_measure or pbi_create_rolling_average_measure.

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

Usage Guidelines3/5

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

The description explains when to use the tool ('Use as the value of a chart visual to surface only the top N members of a dimension') and notes that rank_measure defaults to base_measure. However, it does not mention when not to use it or provide alternatives among the many sibling measure tools.

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/imnotStealthy/powerbi-mcp-local'

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