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
| Stage | Component | Output |
|---|---|---|
| Runtime | EasyFabric 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 metadatapower_bi_model- Optional Power BI model configurationuse_llm_fallback- Whether to use LLM for low-confidence queries
Returns:
DAX query string
Raises:
AmbiguousQueryError- If question maps to multiple entities without clear intentInvalidQueryError- If question cannot be parsed into valid DAX
Related data classes
easyfabric.AmbiguousQueryErroreasyfabric.InvalidQueryError