Dax@1
Dax@1 provider lets you issue queries against tabular models - Power BI and SQL Server Analysis Services (SSAS).
If you need to test local or remote tabular models in SSAS or Power BI, you will find Dax@1
provider useful. It let’s you issue DAX queries against those data sources.
Connect to Power BI Workspace
Your muse have Power BI Premium or Power BI Premium per user in order to connect to a Power BI dataset programatically.
Data Sources:
- Name: My Power BI Dataset
Provider: Dax@1
ConnectionString: >
Provider=MSOLAP;
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. You already must have a service principal with a valid secret and with admin access to your Power BI workspace.
We prepared a thorough tutorial about testing Power BI data both on your machine and in Power BI workspace. If the information above is not sufficient for you (it is only a reference), please follow the tutorial.
Connect to SSAS
Data Sources:
- Name: My Tabular Model
Provider: Dax@1
Connection string: Provider=MSOLAP;data source=localhost;integrated security=SSPI;Catalog=WideWorldImporters
Connection string has these parts:
Part | Notes |
---|---|
Provider | always MSOLAP |
Data source | IP address or name of your server |
Integrated security | SSPI (for local connections to SSAS) |
Catalog | Name of the database you want to run queries against |
Example Test
In this test you compare data returned from a DAX query (it is made up example without much sense) with expected data you provided in 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
Driver Installation
You need to install MSOLAP driver from Microsoft webpage: https://learn.microsoft.com/en-us/analysis-services/client-libraries?view=asallproducts-allversions#windows-installer.
Download and install MSOLAP (amd64):
The link leads to *.MSI file. Simply install the driver using Next, Next, Next…
Note: In near future we’ll get rid of this dependency and CAT will ship with this prerequisite already included.