Symptoms
When running a pipeline that includes steps of type Dataset (for example, performing checks such as Count Rows, Column Statistics, Dataset Values, or Duplicated Rows), the pipeline may fail with an error.
In the Pipeline logs, you might see a message stating:
“Failed to execute the DAX query.”
Cause
This issue typically occurs when your Dataset is configured in DirectQuery mode and connected to a data source hosted on Azure Analysis Services.
The most common scenario is when the semantic model you are currently testing is based on another semantic model.
When the platform attempts to run a test on a table from that base semantic model, the PowerBI API refuses to execute the query because it cannot directly access the underlying data.
To check whether your Dataset is based on another Dataset, use the Lineage view in Power BI. This will help you identify dependencies and confirm the correct source for your tests.
How to fix
To successfully run the test on the table, you need to execute the same step on the original Dataset or directly on the source data (e.g., the initial semantic model or another Analysis Services source).