Skip to main content
Ask Titan Engineering Deep Dive · Part 4 of 7

How we built a Power BI Agent for governed DAX execution

Ask Titan's Power BI Agent uses governed semantic-model metadata and company-specific business context to understand the question, generate DAX and execute it against the configured semantic model.

Power BI DAX Context engineering Semantic models LangGraph
Ask Titan · Power BI Agent
governed context
Control plane · Webadmin
Configure the context
Connection
Metadata
Business context
Runtime
Power BI Agent
select context → reason → generate DAX
DAX ↓ ↑ Result
Power BI semantic model
Measures · relationships · hierarchies · business logic
Principle: Configure meaning once. Select only what the Power BI Agent needs for the current question.

Ask Titan Engineering Deep Dive

Seven articles, one architecture

Part 4 goes behind the Power BI capability boundary and shows how governed business context becomes executable DAX. The series continues with conversation context, enterprise documents and answer traceability.

The engineering problem

Generating DAX is the last step. Understanding the business question comes first.

A business user does not ask for a table, column or measure. They ask why margin declined, which customers caused the change, where yield was lost or how production performed.

Before the Power BI Agent can generate a query, it has to resolve the business meaning behind that question and identify the semantic context needed to answer it.

DAX is the output of that process, not the starting point.

Business question

“Which customers caused our margin decline last month?”

Resolve the question
Meaning
What does “margin” mean here?

Company terminology and business definitions.

Ownership
Where does the logic live?

Semantic model, measures and relationships.

Scope
What context is needed?

Only what is relevant to this question.

Power BI Agent
Reason over the resolved context

Combine the business meaning with the relevant semantic-model context and construct the executable query.

Input
Resolved context
Output
DAX query
ready for semantic-model execution

The difficult part happens before the DAX is generated.

Technical metadata

What exists?

Tables, columns, data types, measures, relationships and sample values.

Business context

What does it mean here?

Company terminology, table and field descriptions, KPI meaning, jargon and process semantics encoded into governed metadata.

Query-time context

What matters now?

Only the tables, schemas, samples and prior execution feedback relevant to the current question.

Context engineering

Metadata is not enough. The agent needs business context

Context engineering is the broader practice of deciding which instructions, tools, external information, state and retrieved data reach the model at inference time. Ask Titan applies that idea to enterprise semantics.

We use business-context engineering as a practical specialization: encode company-specific terminology, definitions and process meaning around a semantic model, then select only the useful parts for the current question.

This is not a Power BI product term. It is how we describe the context-engineering pattern used around governed enterprise data.

Please note

A semantic model tells the AI how data is structured. Business context tells the AI what that data means inside your company.

Three layers of meaning

Structure, governed business logic and company-specific meaning are different things

Keeping these layers separate makes the runtime easier to govern. The semantic model remains the system that owns calculations and relationships. Ask Titan adds an explicit context layer around it instead of copying those semantics into one large agent prompt.

01 · Structure

Technical metadata

Table and field names, data types and model structure tell the agent what can be referenced.

02 · Business logic

Power BI semantic model

Measures, relationships, hierarchies and DAX calculations remain in the semantic-model engine.

03 · Company meaning

Business context

Descriptions and curated metadata explain how the organization uses concepts, fields and terminology.

Ask Titan control plane

Configure the semantic boundary before the question arrives

Ask Titan Webadmin is the control plane for the Power BI capability. Administrators configure the connection, select the semantic model, curate table and field descriptions and save the metadata used by the specialist agent at runtime.

Business documentation can also assist metadata generation. Suggested descriptions are reviewed and editable before they are saved. The runtime consumes the resulting governed metadata; it does not need to rediscover company meaning from scratch for every question.

Business context engineering through the Ask Titan control plane Power BI semantic-model metadata and optional business documentation enter the Ask Titan control plane. Administrators curate and review the context, which is stored as governed semantic-model context. The Power BI Agent selects relevant context from it at runtime. INPUTS SEMANTIC MODEL Power BI model tables · fields · measures relationships · data types sample values OPTIONAL INPUT Business documentation terminology · concepts KPI definitions process meaning company-specific language CONTROL PLANE · WEBADMIN Business context engineering Configure and curate semantic meaning 1 AI generates / curates descriptions 2 Human review and edit 3 Save governed metadata Administration happens before inference GOVERNED RUNTIME CONTEXT PERSISTED CONTEXT Semantic-model context table + field descriptions measure definitions schema + relationships business terminology model + connection configuration RUNTIME Power BI Agent generates and executes DAX, then returns the result SAVE SELECT
Administration happens before inference. Configuration and metadata live in the control plane; query-specific reasoning happens in the runtime.

One question through the capability

From business language to executed semantic-model query

Consider a user asking: “Which retail customers caused our margin decline last month?” The top-level orchestrator only chooses the permitted Power BI capability. The specialist agent owns the execution path behind that boundary.

1 · Question Business language Retail customers, margin decline, last month.
2 · Context Select semantic meaning Relevant tables, measures, descriptions, relationships and samples.
3 · Execution Generate + run DAX The semantic-model engine executes the DAX query and returns the result to the Power BI Agent.
Simplified specialist flow
tables = list_available_tables()
relevant = select_relevant_tables(question, tables)

for table in relevant:
    load_governed_table_context(table)

dax = generate_dax(question, relevant_context)
result = execute_against_semantic_model(dax)

if result.has_error:
    enrich_context_and_retry(result.error)

return result

Just-in-time semantic context

Do not put the entire semantic model into every model call

The specialist first sees the configured table catalog and descriptions. It then loads detailed information only for tables it may need. That detailed context can include field descriptions, data types, relationships and small samples.

When governed metadata exists in Ask Titan, that is used first. If it is unavailable, the implementation can fall back to live Power BI model metadata. This keeps the runtime useful without making curated context optional in the architecture.

01

List the configured table surface

Names and descriptions provide a lightweight map of the model.

02

Select likely relevant tables

The specialist chooses where deeper context is needed for this question.

03

Load detailed governed metadata

Descriptions, schema, relationships and samples enter the agent context only where needed.

04

Generate DAX from that subset

The generation step receives selected context rather than the entire semantic model.

Context-engineering principle: retain a large governed context universe, but pass the model the smallest high-signal subset needed for the next decision.

DAX generation

Generate inside a known semantic boundary

The DAX generation step receives the user question plus the selected schemas, samples and previous execution errors. Public examples below are intentionally rewritten and do not expose Ask Titan's private prompts.

  • Reference only known model fields.
  • Use existing model relationships instead of rebuilding joins.
  • Keep query generation separate from query execution.
  • Carry execution feedback forward when correction is needed.
Public pseudocode · not production source
context = select_context(
    semantic_model=model,
    tables=relevant_tables,
    include=[
        "descriptions",
        "schema",
        "relationships",
        "samples",
    ],
)

dax = generate_dax(
    question=question,
    context=context,
    execution_feedback=previous_errors,
)

Execution

The model generates the query. The semantic-model engine calculates the answer

Ask Titan connects to the configured Power BI / Fabric semantic model and executes DAX through the semantic-model interface. The LLM does not calculate margin, aggregate rows itself or replace the model's measures.

Specialist agent

Generated DAX

Executable query built from the selected context.

Interface

Semantic-model connection

Configured connection to the selected Power BI / Fabric model.

Engine

Result rows

Power BI evaluates model relationships, measures and DAX logic.

Microsoft documents DAX queries as queries that return data from semantic models, and XMLA as a supported connectivity surface for semantic-model tooling. Ask Titan uses that same separation between query generation and semantic-model execution.

Execution-grounded correction

A failed DAX query becomes context for the next attempt

Query generation is not treated as a one-shot prediction. If the semantic-model engine rejects a generated query, the Power BI Agent stores that execution error in transient context. It can then inspect additional table information or generate a revised query.

The loop is designed with deterministic stop controls. We deliberately avoid publishing internal retry thresholds or treating model persistence as the safety boundary.

Power BI Agent DAX execution and correction loop The Power BI Agent generates DAX and sends it to the semantic-model engine. Successful execution returns result evidence. A failed query returns execution feedback, which becomes context for a revised generation pass. POWER BI AGENT Generate DAX selected semantic context SEMANTIC MODEL Execute in Power BI validate and evaluate DAX EXECUTION ERROR Feedback context enrich context · revise query SUCCESS Result evidence rows returned to the agent DAX SUCCESS ERROR REVISED CONTEXT · NEXT PASS
An execution error is not just a failure. It becomes structured feedback for the Power BI Agent before the next query-generation pass.

Choose the layer that owns the semantics

Why not translate every business question directly to SQL?

If margin, sales, yield or another business metric is already governed in a Power BI semantic model, rebuilding that definition in generated SQL creates a second interpretation layer. The Power BI specialist exists so the orchestrator can use the execution model that already owns those semantics.

Question characteristicPower BI semantic modelRaw SQL path
Governed measures already existReuse the existing measure logicMay require reimplementing the metric
Relationships and hierarchies matterUse the model's existing semantic structureAgent must reason about joins and grouping
Detailed operational records are primaryCan be appropriate, depending on model designOften a natural execution path
Business consistency with reportsShares the same governed semantic layerDepends on how the SQL layer is governed
Use the execution model that owns the business semantics you need. The top-level orchestrator does not need to force every question through the same data access pattern.

Governance boundaries

Capability access, source access and semantic meaning are separate controls

Article 3 covered whether the current identity may use the Power BI capability at all. Article 4 starts after that decision. The configured source identity still determines what the semantic-model connection can access, while the model itself owns measures, relationships and other semantic logic.

Application

Capability authorization

May this user invoke the Power BI specialist capability?

Source

Power BI authorization

What can the configured connection identity access in Power BI / Fabric?

Semantics

Model logic

Which measures, relationships, fields and definitions exist in the selected semantic model?

Do not infer end-user RLS passthrough from this architecture. Source-native permissions remain a separate enforcement concern and depend on the identity and connection model used for the deployment.

Engineering takeaway

Do not teach the top-level agent how Power BI works

Put Power BI semantics behind a specialist capability. Configure the connection and company meaning in the control plane. At runtime, select relevant context, generate DAX, execute it in the semantic-model engine and treat the returned rows as evidence.

Patterns we keep

Keep business logic in the semantic model.
Curate company meaning in the control plane.
Use business documentation to assist metadata creation, then review it.
Load detailed context only for relevant tables.
Generate DAX from selected governed context.
Execute DAX in the semantic-model engine.
Use execution errors as transient correction context.
Keep capability and source authorization separate.

One architecture, three responsibilities

Control plane
Configure meaning
Specialist agent
Reason and execute
Semantic model
Own business logic

You should not have to teach the model your business in every prompt. Configure that context once and make it part of the governed AI runtime.

Next in the series

Part 5 · Conversation state + LLM context

How does Ask Titan remember a conversation without sending every previous tool call and result to the model? Part 5 covers LangGraph checkpoints, thread-scoped state, context selection and how oversized tool outputs are handled.

Read Part 5

FAQ

Power BI AI agent, DAX and context-engineering questions

Practical answers about semantic-model context, Ask Titan Webadmin, DAX generation, Power BI execution and governance boundaries.

What is business context engineering in Ask Titan?

It is Ask Titan's application of the broader context-engineering pattern to enterprise semantics: administrators curate company-specific descriptions and metadata around a semantic model so the Power BI specialist can use that meaning at runtime instead of rediscovering it from every prompt.

How is context engineering different from prompt engineering?

Prompt engineering focuses mainly on instructions. Context engineering is broader: it determines which instructions, tools, metadata, external information, state and execution feedback are placed in front of the model for a particular inference step.

What Power BI context can the specialist agent use?

The runtime can use configured table descriptions plus detailed schema information such as field descriptions, data types, relationships and sample values. If governed metadata is unavailable, the implementation can fall back to live semantic-model metadata.

Can business documentation help create the metadata layer?

Yes. In the Ask Titan control plane, business documentation can assist the generation of table and field descriptions. An administrator can review and edit those suggestions before saving the resulting metadata for runtime use.

Does Ask Titan send the whole semantic model to the LLM for every question?

No. The specialist first works from a lightweight configured table surface and loads detailed table context only where it is relevant to the current question. DAX generation can then use that selected subset.

Why query the Power BI semantic model instead of always generating SQL?

When business measures, relationships and hierarchies already live in the semantic model, querying that model reuses the governed business logic instead of reconstructing a second definition in generated SQL.

How does Ask Titan execute DAX?

The specialist generates DAX and sends it through the configured Power BI/Fabric semantic-model connection. The semantic-model engine evaluates the query and returns result rows; the LLM does not calculate the metric itself.

What happens if generated DAX fails?

The execution error is stored as transient context for the specialist. The agent can inspect additional model information or generate a revised query, subject to deterministic stop controls.

Is Power BI capability authorization the same as Power BI data authorization?

No. Ask Titan application policy determines whether the current identity may invoke the Power BI capability. The configured Power BI connection and source-native permissions separately determine what the semantic-model connection can access.

Does this architecture automatically pass through each end user's Power BI RLS?

No such claim should be inferred. Row-level and source-native authorization depend on the identity and connection model used in a deployment and remain separate from Ask Titan's application-level capability authorization.

Business context engineering

Give AI access to governed business meaning, not just table names

Ask Titan combines semantic-model execution with a control plane for connectivity, metadata and company-specific context. That gives specialist agents a stable semantic boundary without moving business logic into one giant prompt.

From configuration to answer

01Connect the governed semantic model
02Curate metadata and business meaning
03Select relevant context at runtime
04Generate and execute DAX against the semantic model

Technical references

The Ask Titan implementation details in this article are simplified from the private product code. These public references document the broader context-engineering pattern and the Power BI semantic-model/DAX interfaces used in the architecture.