Skip to main content

DAX API Overview

For Data Analysts

The DAX API enables Power BI, Excel, and other Analysis Services-compatible tools to query your Olytix Core semantic layer using DAX (Data Analysis Expressions). This provides native integration with Microsoft BI tools while leveraging Olytix Core's unified semantic model.

Key Features

FeatureDescription
DAX Query ExecutionExecute DAX queries against Olytix Core cubes
XMLA ProtocolNative Power BI connectivity via XMLA endpoint
Metadata DiscoveryExpose cubes, dimensions, and measures to clients
Session ManagementStateful connections for Power BI Desktop
IntelliSense SupportQuery completions for DAX editors

Architecture

The DAX API translates DAX queries into Olytix Core semantic queries:

Power BI Desktop  -->  XMLA Protocol  -->  DAX Engine  -->  Semantic Layer  -->  Data Warehouse
  • DAX Parser: Parses DAX syntax into an AST
  • DAX Translator: Converts DAX concepts to Olytix Core semantic queries
  • XMLA Handler: Implements XMLA protocol for Power BI connectivity
  • Metadata Provider: Exposes cube metadata to clients

Concept Mapping

Olytix Core maps DAX concepts to semantic layer constructs:

DAX ConceptOlytix Core Equivalent
TableCube
ColumnDimension
MeasureMeasure
SUMMARIZECOLUMNSQuery with dimensions and measures
FILTERSemantic filters
CALCULATEModified filter context

API Endpoints

REST Endpoints

EndpointMethodDescription
/api/v1/dax/executePOSTExecute a DAX query
/api/v1/dax/validatePOSTValidate DAX syntax
/api/v1/dax/functionsGETList supported DAX functions
/api/v1/dax/completionsPOSTGet IntelliSense completions
/api/v1/dax/cubesGETList available cubes

XMLA Endpoint

EndpointMethodDescription
/api/v1/dax/xmlaPOSTXMLA SOAP endpoint for Power BI

Quick Example

Execute a DAX query via REST:

curl -X POST http://localhost:8000/api/v1/dax/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "EVALUATE SUMMARIZECOLUMNS(orders[region], \"Total Revenue\", SUM(orders[amount]))"
}'

Response:

{
"columns": [
{"name": "region", "data_type": "String", "is_measure": false},
{"name": "Total Revenue", "data_type": "Double", "is_measure": true}
],
"data": [
{"region": "NORTH", "Total Revenue": 125000.00},
{"region": "SOUTH", "Total Revenue": 98500.00},
{"region": "EAST", "Total Revenue": 112000.00},
{"region": "WEST", "Total Revenue": 87500.00}
],
"row_count": 4,
"execution_time_ms": 45.2,
"from_cache": false
}

XMLA Protocol Basics

The XMLA (XML for Analysis) protocol enables Analysis Services-compatible tools to communicate with Olytix Core. XMLA uses SOAP over HTTP with two primary operations:

Discover

Retrieves metadata about cubes, dimensions, measures, and server properties.

<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>MDSCHEMA_CUBES</RequestType>
<Restrictions>
<RestrictionList>
<CATALOG_NAME>Olytix Core</CATALOG_NAME>
</RestrictionList>
</Restrictions>
<Properties>
<PropertyList>
<Catalog>Olytix Core</Catalog>
</PropertyList>
</Properties>
</Discover>

Execute

Executes DAX queries and returns results.

<Execute xmlns="urn:schemas-microsoft-com:xml-analysis">
<Command>
<Statement>
EVALUATE
SUMMARIZECOLUMNS(
orders[region],
"Revenue", SUM(orders[amount])
)
</Statement>
</Command>
<Properties>
<PropertyList>
<Catalog>Olytix Core</Catalog>
</PropertyList>
</Properties>
</Execute>

Supported Discovery Types

Schema RowsetDescription
MDSCHEMA_CUBESList available cubes
MDSCHEMA_DIMENSIONSList dimensions in cubes
MDSCHEMA_MEASURESList measures in cubes
MDSCHEMA_HIERARCHIESList dimension hierarchies
MDSCHEMA_LEVELSList hierarchy levels
DBSCHEMA_TABLESList tables (cubes)
DBSCHEMA_COLUMNSList columns (dimensions/measures)
DISCOVER_PROPERTIESServer properties
DISCOVER_DATASOURCESData source information

Session Management

XMLA supports stateful sessions for maintaining context across multiple requests:

# Create a session
curl -X POST http://localhost:8000/api/v1/dax/sessions \
-H "Authorization: Bearer YOUR_API_KEY"

# Response
{
"session_id": "sess_abc123",
"created_at": "2024-01-20T10:30:00Z",
"timeout_seconds": 3600
}

Include the session ID in subsequent requests:

curl -X POST http://localhost:8000/api/v1/dax/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Session-ID: sess_abc123" \
-H "Content-Type: application/json" \
-d '{"query": "EVALUATE orders"}'

Security

DAX queries respect Olytix Core's security model:

  • Row-Level Security (RLS): Filters are automatically applied based on user context
  • Column-Level Security: Masked columns return obfuscated values
  • Authentication: API key or JWT token required

Supported DAX Functions

Olytix Core supports common DAX functions across these categories:

CategoryExamples
AggregationSUM, COUNT, COUNTROWS, AVERAGE, MIN, MAX, DISTINCTCOUNT
FilterFILTER, ALL, ALLEXCEPT, CALCULATE, CALCULATETABLE
TableSUMMARIZECOLUMNS, SUMMARIZE, ADDCOLUMNS, SELECTCOLUMNS
InformationISBLANK, ISERROR, HASONEVALUE
LogicalIF, AND, OR, NOT, SWITCH
Date/TimeYEAR, MONTH, DAY, TODAY, NOW

See DAX Queries for detailed function support.

Next Steps