Medium severityquery
Power BI Refresh Error:
UNSUPPORTED_SUBQUERY_EXPRESSION_CATEGORY
What does this error mean?
A subquery was used in a position or with a pattern that Spark SQL does not support. This commonly occurs with correlated subqueries that reference outer-query columns in unsupported ways.
Common causes
- 1Correlated subquery in a SELECT list that references multiple outer columns in an unsupported combination
- 2Subquery inside an IN clause that also references an outer-query column (non-equi correlated IN)
- 3Scalar subquery that returns more than one column
- 4Subquery in an aggregate function argument
- 5LATERAL subquery pattern not supported in the current Databricks Runtime version
How to fix it
- 1Rewrite correlated subqueries as JOINs or LEFT JOINs with aggregate subqueries in the ON or USING clause
- 2Replace IN (subquery) with EXISTS or a JOIN to gain more control over correlation
- 3Materialise the subquery as a CTE (WITH clause) and then join to it
- 4For window-function alternatives, use PARTITION BY to replicate correlated aggregation
- 5Check the Databricks Runtime release notes — some correlated subquery patterns were added in later versions