pql-test
Run Your Semantic Model Tests from the Command Line
pql-test is a command-line tool that discovers and executes the DAX tests stored inside your Power BI Project (PBIP) semantic models, connecting to Analysis Services over XMLA. Tests live as .dax files alongside your model and are written with the PQL.Assert function family.
Where PQL.Assert gives you the assertions that live inside the model, pql-test is the automation half: it runs those assertions against a local Power BI Desktop session or a deployed Power BI Premium or Microsoft Fabric workspace, and reports the results in a form your terminal and your pipeline can both read.
Watch the Introduction
A walkthrough of what pql-test is, how it finds your tests, and how to run them.

Key Capabilities
Connect Anywhere
- ✓Auto-detects a locally open Power BI Desktop instance
- ✓Connects to Power BI Premium and Microsoft Fabric workspaces
- ✓Interactive, service principal, certificate, and managed identity authentication
- ✓Downloads ADOMD.NET automatically on first use
- ✓Tests RLS and OLS through role impersonation
Built for Automation
- ★Native Azure DevOps and GitHub Actions annotations via --log-format
- ★Full JSON results for programmatic consumption via --output
- ★Run only the suites for one environment with --env
- ★Catch breaking model changes before they ship
- ★The same tests run locally and in your pipeline
Get Started
Install from PyPI:
pip install pql-testCommands
Verify that all required packages and tools are available.
List the DAX test suites found in a model.
Show a specific DAX test suite by name.
Run all DAX test suites in a PBIP model via XMLA. Results print in a pytest-style format by default.
Manage authentication for pql-test.
Pointing at a model
MODEL_PATH accepts a locally-open Power BI Desktop model (local/<model_name>), a canonical Fabric service path (<workspace>.Workspace/<model>.SemanticModel), or a PBIP root directory. Quote the path when a workspace or model name contains spaces or parentheses.
Examples
# Run against a locally-open Power BI Desktop model
pql-test run-tests local/SampleModel
# Or point at a PBIP project folder
pql-test run-tests ./examples/SampleModel.SemanticModel
# Run against a deployed model in a workspace
pql-test run-tests "MyWorkspace.Workspace/MyModel.SemanticModel"
# Only run the suites targeting one environment
pql-test run-tests ./examples/SampleModel.SemanticModel --env DEV
# Emit CI annotations and save full JSON results
pql-test run-tests local/SampleModel --log-format github --output results.jsonResources
Download the package from PyPI.
Running more than semantic model tests? fab-test wraps pql-test alongside BPA, PBIR Inspector, and Playwright in a single CLI.
Learn about fab-test