REMOVEFILTERS
从指定表 or 列中清除 filters。
语法
REMOVEFILTERS([<table> | <column>[, <column>[, <column>[,…]]]])
parameters
术语 | 定义 |
---|---|
表 | 要清除 filters 的表。 |
柱形图 | 要清除 filters 的列。 |
返回 value
不适用。 请参阅备注。
备注
REMOVEFILTERS 只能用于清除 filters,但 not 返回表。
在计算列 or 行级别安全性 (RLS) 规则中使用时,not 支持在 DirectQuery 模式下使用此函数。
示例 1
DAX 查询
DEFINE
MEASURE FactInternetSales[TotalSales] = SUM(FactInternetSales[SalesAmount])
MEASURE FactInternetSales[%Sales] = DIVIDE([TotalSales], CALCULATE([TotalSales],REMOVEFILTERS()))
EVALUATE
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL(DimProductCategory[EnglishProductCategoryName], "IsGrandTotal"),
"TotalSales", [TotalSales],
"%Sales", [%Sales]
)
ORDER BY
[IsGrandTotal] DESC, [TotalSales] DESC
返回结果
DimProductCategory[EnglishProductCategoryName] | [IsGrandTotal] | [TotalSales] | [%Sales] |
---|---|---|---|
行 1 | True | 29358677.2207 | 1 |
Bikes | False | 28318144.6507 | 0.964557920570538 |
Accessories | False | 700759.96 | 0.023868921434441 |
Clothing | False | 339772.61 | 0.0115731579950215 |
示例 2
DAX 查询
DEFINE
MEASURE FactInternetSales[TotalSales] = SUM(FactInternetSales[SalesAmount])
MEASURE FactInternetSales[%Sales] = DIVIDE([TotalSales], CALCULATE([TotalSales],REMOVEFILTERS(DimProductSubcategory[EnglishProductSubcategoryName])))
EVALUATE
SUMMARIZECOLUMNS(
DimProductCategory[EnglishProductCategoryName],
DimProductSubcategory[EnglishProductSubcategoryName],
"TotalSales", [TotalSales],
"%Sales", [%Sales]
)
ORDER BY
DimProductCategory[EnglishProductCategoryName] ASC,
DimProductSubcategory[EnglishProductSubcategoryName] ASC
返回结果
DimProductCategory [EnglishProductCategoryName] | DimProductSubcategory [EnglishProductSubcategoryName] | [TotalSales] | [%Sales] |
---|---|---|---|
Accessories | 自行车车架 | 39360 | 0.05616759 |
Accessories | 单车存放架 | 39591 | 0.05649723 |
Accessories | 瓶子 and 笼子 | 56798.19 | 0.08105228 |
Accessories | 清洁剂 | 7218.6 | 0.0103011 |
Accessories | 挡泥板 | 46619.58 | 0.06652717 |
Accessories | 头盔 | 225335.6 | 0.3215589 |
Accessories | 水袋背包 | 40307.67 | 0.05751994 |
Accessories | 轮胎 and 管 | 245529.32 | 0.35037578 |
Bikes | 山地自行车 | 9952759.564 | 0.35146228 |
Bikes | 公路自行车 | 14520584.04 | 0.51276608 |
Bikes | 观光自行车 | 3844801.05 | 0.13577164 |
Clothing | 上限 | 19688.1 | 0.05794493 |
Clothing | 手套 | 35020.7 | 0.10307099 |
Clothing | 运动衫 | 172950.68 | 0.5090189 |
Clothing | 短裤 | 71319.81 | 0.20990453 |
Clothing | 袜子 | 5106.32 | 0.01502864 |
Clothing | 背心 | 35687 | 0.10503201 |