English 中文(简体)
DAX Parameter Naming Conventions
  • 时间:2024-12-22

DAX Parameter Naming Conventions


Previous Page Next Page  

DAX has standard parameter names to faciptate the usage and understanding of the DAX functions. Further, you can use certain prefixes to the parameter names. If the prefix is clear enough, you can use the prefix itself as the parameter name.

To understand the syntax of the DAX functions and to use data values appropriately for the relevant DAX function parameters, you need to understand DAX parameter naming conventions.

Parameter Names

Following are the DAX standard parameter names −

Sr.No. Parameter Name & Description
1

expression

Any DAX expression that returns a single scalar value, where the expression is to be evaluated multiple times (for each row/context).

2

value

Any DAX expression that returns a single scalar value where the expression is to be evaluated exactly once before all other operations.

3

table

Any DAX expression that returns a table of data.

4

tableName

The name of an existing table using standard DAX syntax. It cannot be an expression.

5

columnName

The name of an existing column using standard DAX syntax, usually fully quapfied. It cannot be an expression.

6

name

A string constant that will be used to provide the name of a new object.

7

order

An enumeration used to determine the sort order.

8

ties

An enumeration used to determine the handpng of tie values.

9

type

An enumeration used to determine the data type for PathItem and PathItemReverse.

Prefixing Parameter Names or Using the Prefix Only

You can quapfy a parameter name with a prefix −

    The prefix should be descriptive of how the argument is used.

    The prefix should be in such a way that ambiguous reading of the parameter is avoided.

For example,

    Result_ColumnName − Refers to an existing column used to get the result values in the DAX LOOKUPVALUE () function.

    Search_ColumnName − Refers to an existing column used to search for a value in the DAX LOOKUPVALUE () function.

You can omit the parameter name and use only the prefix, if the prefix is clear enough to describe the parameter. Omitting the parameter name and using only prefix can sometimes help in avoiding the clutter during reading.

For example, Consider DATE (Year_value, Month_value, Day_value). You can omit the parameter name – value, that is repeated thrice and write it as DATE (Year, Month, Day). As seen, by using only the prefixes, the function is more readable. However, sometimes the parameter name and the prefix have to be present for clarity.

For example, Consider Year_columnName. The parameter name is ColumnName and the prefix is Year. Both are required to make the user understand that the parameter requires a reference to an existing column of years.

Advertisements