活动
REMOVEFILTERS
从指定表或列中清除筛选器。
DAX
REMOVEFILTERS([<table> | <column>[, <column>[, <column>[,…]]]])
术语 | 定义 |
---|---|
表 | 要清除筛选器的表。 |
柱形图 | 要清除筛选器的列。 |
不适用。 请参阅备注。
REMOVEFILTERS 只能用于清除筛选器,不能返回表。
在已计算的列或行级安全性 (RLS) 规则中使用时,不支持在 DirectQuery 模式下使用此函数。
DAX 查询
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 | 正确 | 29358677.2207 | 1 |
Bikes | 错误 | 28318144.6507 | 0.964557920570538 |
Accessories | 错误 | 700759.96 | 0.023868921434441 |
Clothing | 错误 | 339772.61 | 0.0115731579950215 |
DAX 查询
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 | 瓶子和笼子 | 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 | 轮胎和内胎 | 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 |