Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

DAX Generation (NL → DAX)

Overview

Rule-based + LLM fallback generator that turns a natural-language question against a Model into a DAX query.

What gets generated

StageComponentOutput
RuntimeEasyFabric Runtime (EFR)easyfabric.generate_dax_from_question

EasyFabric Runtime

generate_dax_from_question

def generate_dax_from_question(question: str,
model: Model,
power_bi_model: Optional[PowerBIModel] = None,
use_llm_fallback: bool = True) -> str

Generate DAX query from a natural language question using hybrid approach.

Arguments:

  • question - Natural language query (e.g., "Give me top 10 Cities by Revenue")
  • model - Analytical Model with table/column metadata
  • power_bi_model - Optional Power BI model configuration
  • use_llm_fallback - Whether to use LLM for low-confidence queries

Returns:

DAX query string

Raises:

  • AmbiguousQueryError - If question maps to multiple entities without clear intent
  • InvalidQueryError - If question cannot be parsed into valid DAX
  • easyfabric.AmbiguousQueryError
  • easyfabric.InvalidQueryError