DAX Syntax Reference

DAX Syntax Reference

This document provides a comprehensive reference for the Data Analysis Expressions (DAX) syntax used in SQL Server Analysis Services, Power BI, and Excel Power Pivot.

Core Concepts

DAX is a formula expression language used to create custom calculations in Analysis Services data models. Key components include:

Syntax Structure

DAX formulas generally follow this structure:

<Formula> = <Expression>

Where:

Common DAX Functions and Their Syntax

Aggregation Functions

These functions perform calculations across a set of values.

Logical Functions

These functions perform logical tests.

Text Functions

These functions manipulate text strings.

Date and Time Functions

These functions work with dates and times.

Statistical Functions

These functions perform statistical calculations.

Common DAX Operators and Their Syntax

Note on Context

Understanding Row Context and Filter Context is crucial for writing effective DAX formulas. Functions like CALCULATE are fundamental for manipulating filter context.

Tip for Performance

Prefer using measures over calculated columns for aggregations that change based on filters. Measures are evaluated on-the-fly, making them more efficient for dynamic analysis.

For a complete list of DAX functions, operators, and detailed explanations, please refer to the official DAX Function Reference.