DAX syntax best practices
DAX syntax best practices
| DAX syntax refers to the rules and conventions used to write DAX formulas. It includes
functions, operators, and expressions that are used to manipulate and aggregate data.
02. Learning how to create effective DAX formulas will help us get the most
Why learn DAX syntax? out of our data to solve real business problems that affect our bottom line.
2
Calculated columns with DAX
Measure_name = Function_name(Table_name[Column_name])
A B E F
C The DAX function to be used, for example, SUM. The referenced column. F
3
Calculated columns with DAX
● When naming tables, columns, measures, or Do: clear and descriptive naming
variables, choose names that clearly convey the
purpose or content.
Indicator_type =
RIGHT('Indicator'[Indicator_ID], 2)
● Opt for a naming convention that aligns with your == "EQ"
project and team standards.
● Always avoid generic names or abbreviations that Donʼt: generic names and abbreviations
may lead to confusion.
Column_7 =
RIGHT( 'Data_1'[IID], 2 ) == "EQ"
4
Calculated columns with DAX
● Consistency should be applied across all 01. Within a single database all tables must have
elements, including tables, columns, measures, unique names.
and variables within your DAX formulas. 02. The names of the columns within each table
must be unique:
● Adopting a standardised approach to naming a. Columns in different tables may possess
ensures that anyone working on the project can the same names.
quickly interpret and navigate the codebase. b. When the same column name is referenced
from two or more tables, we must use a
● This practice promotes collaboration, reduces fully qualified name – that is, the
errors, and enhances the overall maintainability 'Table_name' followed by the
of our Power BI solution. [Column_name].
03. All objects (tables, columns, and measures) are
case insensitive. For instance, the names
‘DATE TABLEʼ and ‘Date Tableʼ would represent
the same table.
5
Calculated columns with DAX