MetricSign
EN|NLRequest Access
Medium severityexecution

Power BI Refresh Error:
CORTEX_ANALYST_QUERY_GENERATION_FAILED

What does this error mean?

Snowflake Cortex Analyst failed to generate or execute a SQL query from a natural-language question, typically because the semantic model is incomplete or the question is outside its coverage.

Common causes

  • 1The semantic model YAML is missing table, column, or measure definitions that the question requires
  • 2The natural-language question references a concept not mapped in the semantic model
  • 3The underlying table or view referenced in the semantic model no longer exists or was renamed
  • 4The Cortex Analyst REST API request has an invalid semantic_model_file path in the request body

How to fix it

  1. 1Step 1: Inspect the error response body — Cortex Analyst returns an error message indicating which part of the query generation failed.
  2. 2Step 2: Review the semantic model YAML file for missing or incomplete table, column, and measure definitions.
  3. 3Step 3: Verify that all tables and views referenced in the semantic model exist in Snowflake and are accessible to the role making the request.
  4. 4Step 4: Test the semantic model by submitting a simple, well-defined question to isolate whether the error is model-level or query-level.
  5. 5Step 5: Use the Verified Query Repository to add curated example SQL for common question patterns.

Frequently asked questions

What is a semantic model in Cortex Analyst?

A semantic model is a YAML file that maps business concepts to Snowflake tables, columns, and metrics. It defines synonyms, relationships, and measure formulas so Cortex Analyst can translate natural-language questions into accurate SQL.

How do I debug which part of the semantic model is causing the error?

Enable streaming responses in the Cortex Analyst REST API to get step-by-step generation details. Also check CORTEX_ANALYST_REQUESTS_V in the INFORMATION_SCHEMA to review the most recent request payloads and response codes.

Other execution errors