📅  最后修改于: 2020-12-01 04:50:11             🧑  作者: Mango
DAX具有强大的筛选器功能,与Excel函数完全不同。查找功能通过使用表和关系(例如数据库)来工作。过滤功能使您可以操纵数据上下文以创建动态计算。
注–返回表的DAX筛选器函数不会将该表添加到数据模型中。结果表用作另一个DAX函数的参数。即,这种DAX函数与其他DAX函数一起用作嵌套函数。
在下一部分中,您将学习可以使用的DAX过滤器功能。有关这些功能的更多详细信息,请参阅本教程库中的教程– DAX功能。
以下是DAX筛选器功能-
Sr.No. | DAX Function & What the Function Does? | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 |
ADDMISSINGITEMS ( Adds combinations of items from multiple columns to a table if they do not already exist. The determination of which item combinations to add is based on referencing source columns which contain all the possible values for the columns. To determine the combinations of items from different columns to evaluate − ALL ( { Returns all the rows in the given table or all the values in the specified columns in a table, ignoring any filters that might have been applied. This function is useful for clearing filters and creating calculations on all the rows in a table. ALLEXCEPT ( Removes all context filters in the table except filters that have been applied to the columns specified as arguments. As against ALL, you can use this function when you want to remove the filters on many, but not all, columns in a table. ALLNOBLANKROW ( From the parent table of a relationship, returns − The function disregards any context filters that might exist. ALLSELECTED ( [ Removes context filters from columns and rows in the current query, while retaining all other context filters or explicit filters. CALCULATE ( Evaluates an expression in a context that is modified by the specified filters. Returns the value that is the result of the expression. CALCULATETABLE ( Evaluates a table expression in a context modified by the given filters. Returns a table of values. CROSSFILTER ( Specifies the cross-filtering direction to be used in a calculation for a relationship that exists between two columns. Does not return any value. DISTINCT ( Returns a one-column table that contains the distinct values from the specified column. In other words, duplicate values are removed and only unique values are returned. The resulting column is used as an argument in another DAX function. EARLIER ( Returns the current value of the specified column in an outer evaluation pass of the mentioned column specified by the number. EARLIEST ( Returns the current value of the specified column in an outer evaluation pass of the specified column. FILTER ( Returns a table that contains only the filtered rows. FILTER is used only as a function that is embedded in other functions that require a table as an argument. FILTERS ( Returns the values that are directly applied as filters to columnName. FILTERS is used only as a function that is embedded in other functions that require a table as an argument. HASONEFILTER ( Returns TRUE when the number of directly filtered values on columnName is one. Otherwise, returns FALSE. HASONEVALUE ( Returns TRUE when the context for columnName has been filtered down to one distinct value only. Otherwise, returns FALSE. ISCROSSFILTERED ( Returns TRUE when columnName or another column in the same or related table is being filtered. ISFILTERED ( Returns TRUE when columnName is being filtered directly. If there is no filter on the column or if the filtering happens because a different column in the same table or in a related table is being filtered, then the function returns FALSE. KEEPFILTERS ( Modifies how filters are applied while evaluating a CALCULATE or CALCULATETABLE function. RELATED ( Returns a related value from another table. RELATEDTABLE ( Evaluates a table expression in a context modified by the given filters. SUBSTITUTEWITHINDEX ( Returns a table which represents a left semijoin of the two tables supplied as arguments. The semijoin is performed by using common columns, determined by common column names and common data type. The columns being joined on are replaced with a single column in the returned table which is of type integer and contains an index. The index is a reference into the right join table given a specified sort order. USERELATIONSHIP ( Specifies the relationship to be used in a specific calculation as the one that exists between columnName1 and columnName2. VALUES ( Returns a one-column table that contains the distinct values from the specified table or column. In other words, duplicate values are removed and only unique values are returned. |