首页 > 解决方案 > PowerBI:按对外部过滤器敏感的类别计算百分比

问题描述

首先,感谢您花时间阅读我的问题:)。

我有下表:

ISO_code Q7_1.其他中央政府机构 OGP 文件类型
精氨酸 0 OGP OGP/开放政府
手臂 1 非 OGP 数字化/数字政府

我想按文档类型(例如 OGP/Open Government)计算 Q7_1(例如总理)的每个答案的百分比,因此我生成了测量公式:

Q7. Central gov institutions = DIVIDE(CALCULATE(SUM('Multiple
answer'[Q7_1.othercentralgovagency]),ALLEXCEPT('Multiple
answer','Multiple answer'[Document
Type])),CALCULATE(COUNTROWS('Multiple answer'),ALLEXCEPT('Multiple
answer','Multiple answer'[Document Type])))

这很好用,它返回“Q7_1.othercentralgovagency”(=1)占我数据集中 OGP/Open Government 总数的百分比。

但是,由于我使用了“ALLEXCEPT”,当我尝试从切片器中按“OGP”列过滤值时,结果不会改变。

如何确保我的公式考虑用户选择的任何其他过滤器?

再次感谢!

标签: daxpowerbi-desktop

解决方案


推荐阅读