Connecting
DSCMD supports all the same connection types as the DAX Studio User Interface does with the exception of Power Pivot. Power Pivot does not support external tools connecting in, you can only connect when using the Excel add-in for the DAX Studio user interface.
There are 2 main ways of connecting for most commands.
1. Using Server name and Database name
Server Name
All commands support using --server or -s for connecting to an endpoint that supports Tabular models and the XMLA protocol.
| Data Source | examples |
|---|---|
| SSAS on-prem | myserver myserver\instance |
| Fabric / Power BI Premium XMLA Endpoint | powerbi:// |
| Azure AS | asazure:// |
| Power BI Desktop | localhost:1234 "My Report.pbix" "Adventure Works.pbip" |
| Power Pivot | Not supported |
Power BI Desktop
You can connect to Power BI Desktop in 2 different ways
- you can either use the
--server localhost:<port>format where you would get the<port>number by running a script or copying it from the DAX Studio UI. - You can use the
--server filename.pbixor--server filename.pbipwherefilenameis the name of the file excluding the path
Database Name
The -d or --database parameter is used for specifing the specific database / model / dataset to connect to if that endpoint supports multiple of these. The database option is not required for Power BI Desktop connections, but it is required for all other connection types
2. Using a Connection String
You can build your own connection string using examples like the following: https://www.connectionstrings.com/olap-analysis-services/ this requires a bit more expertise, but it gives you the ability to use all of the optional connection string properties
Examples
The following examples use the CSV command to run output to a file called c:\temp\stores.csv
SSAS on-prem
using --server and --database
dscmd CSV c:\temp\stores.csv --server myserver --database "Adventure Works" --query "EVALUATE stores"
using -c for a connectionstring
dscmd CSV c:\temp\stores.csv -c "data source=myserver;initial catalog=Adventure Works" --query "EVALUATE stores"
Fabric / Power BI Premium XMLA Endpoint
Azure AS
Power BI Desktop
Using just --server
dscmd CSV c:\temp\stores.csv --server "Adventure Works.pbix" --query "EVALUATE stores"