Excel Dax 简明教程
Excel DAX - Standard Parameters
DAX 有 standard parameter 名称,以促进使用和理解 DAX 函数。此外,您可以对参数名称使用某些前缀。如果前缀足够明确,您可以将前缀本身用作参数名称。
DAX has standard parameter names to facilitate 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.
Standard Parameter Names
以下为 DAX 的标准参数名称:
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 qualified. 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 handling of tie values. |
9 |
type An enumeration used to determine the data type for PathItem and PathItemReverse. |
Prefixing Parameter Names
您可以用前缀来限定参数名称:
You can qualify 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.
Using Only the Prefix as a Parameter
如果您前缀足够明确,以至于可以描述参数,则可以省略参数名称,仅使用前缀。省略参数名称,仅使用前缀有时有助于避免在阅读时混乱。
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 the prefix can sometimes help in avoiding the clutter in reading.
例如,考虑 DATE (Year_value, Month_value, Day_value)。您可以省略参数名称 - value,它重复了三次,并将其写成 DATE (Year, Month, Day)。如您所见,仅使用前缀,函数更具可读性。
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 you can observe, by using only the prefixes, the function is more readable.
但是,有时必须存在参数名称和前缀才能使之清晰。
However, sometimes the parameter name and the prefix have to be present for clarity.
例如,考虑 Year_columnName。参数名称是 ColumnName,前缀是 Year。两者都是必需的,以使用户了解参数需要对年份的现有列进行引用。
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 the existing column of years.