---
title: "Dax@2"
description: "Dax@2 — Power BI, MS Fabric and Azure Analysis Services semantic models and SSAS tabular and multidimensional models, queried in DAX or MDX, no driver needed"
url: "https://docs.justcat.it/reference/data-sources/providers/dax-2/"
---
# Dax@2


## Connects to

Semantic models in Power BI and Microsoft Fabric workspaces, semantic models in Azure Analysis Services, and tabular and multidimensional models in SQL Server Analysis Services (SSAS): Power BI Semantic Model, MS Fabric Semantic Model, Azure Analysis Services, SQL Server Analysis Services.

It is technically possible to query a locally open Power BI Desktop file through `Dax@2`, but [PowerBI@2](https://docs.justcat.it/reference/data-sources/providers/powerbi-2/ "PowerBI@2") is much more convenient for that case.

## Example


**Properties**



Name
: My Power BI Dataset

Provider
: Dax@2

Technology
: PowerBISemanticModel

Connection string
: ```
  Data Source=powerbi://api.powerbi.com/v1.0/your-organization.com/your-workspace-name;
  Initial Catalog=Your-Dataset-Name;
  User ID=%YOUR_SERVICE_PRINCIPAL_NAME_ENVIRONMENT_VARIABLE_NAME%;
  Password=%YOUR_SERVICE_PRINCIPAL_SECRET_ENVIRONMENT_VARIABLE_NAME%;
  ```





**YAML**


```yaml
Data sources:
- Name: My Power BI Dataset
  Provider: Dax@2
  Technology: PowerBISemanticModel
  Connection string: >
    Data Source=powerbi://api.powerbi.com/v1.0/your-organization.com/your-workspace-name;
    Initial Catalog=Your-Dataset-Name;
    User ID=%YOUR_SERVICE_PRINCIPAL_NAME_ENVIRONMENT_VARIABLE_NAME%;
    Password=%YOUR_SERVICE_PRINCIPAL_SECRET_ENVIRONMENT_VARIABLE_NAME%;
```




Replace the placeholders (your-organization.com, your-workspace-name and your-dataset-name) with real values.

## Connection string

An Analysis Services (ADOMD.NET) connection string — `Key=Value` pairs separated by semicolons. The keys you will use most:

| Key | Meaning |
|---|---|
| `Data Source` | For a Power BI or MS Fabric workspace its XMLA endpoint, `powerbi://api.powerbi.com/v1.0/<organization>/<workspace>`; for Azure Analysis Services the `asazure://…` address; for SSAS the server name |
| `Initial Catalog`, `Catalog` | The semantic model (dataset, database) to query |
| `User ID`, `Password` | Service principal name and secret |
| `Integrated Security` | `SSPI` for a local SSAS instance |

The full list is in the <a href="https://learn.microsoft.com/en-us/analysis-services/instances/connection-string-properties-analysis-services" target="_blank">Analysis Services connection string reference</a>.

A password, or the whole string, can come from an environment variable — `%NAME%` is replaced with the value of `NAME`; see [How every provider is used](https://docs.justcat.it/reference/data-sources/providers/introduction/#how-every-provider-is-used "How every provider is used").

**Workspaces.** A Power BI or MS Fabric workspace is reached through its XMLA endpoint, which needs Power BI Premium, Premium per user or a Fabric capacity. The example above signs in as a service principal that has a secret and access to the workspace. Without a service principal you can still automate your tests, but expect the standard Microsoft login prompt — leave both credentials empty:


**Properties**



Name
: My Power BI Dataset

Provider
: Dax@2

Technology
: PowerBISemanticModel

Connection string
: ```
  Data Source=powerbi://api.powerbi.com/v1.0/your-organization.com/your-workspace-name;
  Initial Catalog=Your-Dataset-Name;
  User ID=;
  Password=;
  ```





**YAML**


```yaml
Data sources:
- Name: My Power BI Dataset
  Provider: Dax@2
  Technology: PowerBISemanticModel
  Connection string: >
    Data Source=powerbi://api.powerbi.com/v1.0/your-organization.com/your-workspace-name;
    Initial Catalog=Your-Dataset-Name;
    User ID=;
    Password=;
```




Both ways of testing Power BI data — on your machine and in a workspace — are walked through in [Test Power BI](https://docs.justcat.it/how-to-guides/data-platforms/power-bi/test-power-bi/ "Test Power BI").

**SSAS.** A local or on-premises instance, with integrated security:


**Properties**



Name
: My Tabular Model

Provider
: Dax@2

Technology
: Ssas

Connection string
: ```
  Provider=MSOLAP;
  data source=localhost;
  integrated security=SSPI;
  Catalog=WideWorldImporters;
  ```





**YAML**


```yaml
Data sources:
- Name: My Tabular Model
  Provider: Dax@2
  Technology: Ssas
  Connection string: >
    Provider=MSOLAP;
    data source=localhost;
    integrated security=SSPI;
    Catalog=WideWorldImporters;
```




The `Provider=MSOLAP;` part is accepted and not needed — the driver is ADOMD.NET.

## Settings

None beyond `Connection string`.

## Query

Tabular and semantic models do not understand SQL. The statement is one <a href="https://learn.microsoft.com/en-us/dax/" target="_blank">DAX</a> query — **knowledge of at least the very basics of DAX is required**; multidimensional models in SSAS take MDX instead. [GUI for DAX queries](https://docs.justcat.it/how-to-guides/data-platforms/power-bi/get-the-dax-query-behind-a-visual/ "GUI for DAX queries") shows how to build a query without prior DAX knowledge.

A test comparing the data a DAX query returns (a made-up example without much sense) with expected data provided in YAML:

```yaml
Tests:
- Name: Check zip codes
  First Data Source: MyTabularModel
  First Query: |
    EVALUATE(
    	TOPN(3,VALUES('Customer'[Postal Code]))
    )
    ORDER BY 'Customer'[Postal Code]
  Second data source: yaml
  Second Query: /Expected results
  Expectation: sets match
```

## Prerequisites

None. The driver ships with CAT; Windows and Linux alike.

## Limitations

* Cannot serve lists of definitions — DAX returns column names in square brackets (`Tests[Test name]`, `[Test name]`), which CAT does not match to property names.

## Serving test and data source definitions

`Dax@2` cannot serve [lists](https://docs.justcat.it/reference/project-file/lists/ "Lists") of definitions. A DAX query returns its column names in square brackets — `Tests[Test name]` for a model column, `[Test name]` for a column the query names itself — and CAT matches definition properties by name, brackets included: `[Test name]` is not `Test name`.

## Related

* [Technologies](https://docs.justcat.it/reference/data-sources/technologies/ "Technologies") — the semantic and tabular model platforms this provider serves.
* [Test Power BI](https://docs.justcat.it/how-to-guides/data-platforms/power-bi/test-power-bi/ "Test Power BI") — testing a local file and a workspace model, step by step.
* [GUI for DAX queries](https://docs.justcat.it/how-to-guides/data-platforms/power-bi/get-the-dax-query-behind-a-visual/ "GUI for DAX queries") and [DAX introduction](https://docs.justcat.it/how-to-guides/data-platforms/power-bi/sql-to-dax/ "DAX introduction") — getting started with DAX.

