计算 Power BI 中 RowTotal 的百分比而不是 GrandTotal

时间:2021-06-02 10:54:39

标签: powerbi percentage

我是 Power BI 的新手,我正在尝试根据 rowTotal 而不是 GrandTotal 来计算百分比。例如 - 用我在 excel 中的数据集 -

RAW 数据就像 -enter image description here

从这些原始数据我想要这样的计算 - enter image description here

1 个答案:

答案 0 :(得分:1)

要解决的非常简单的问题,如果有帮助,请接受解决方案:

  1. 从原始表中,创建 Total 度量:

    Total = SUM(Sheet2[Compliant]) + SUM(Sheet2[Non-Compliant])

  2. 创建 Percentage 度量

    Percentage = SUM(Sheet2[Compliant]) / (SUM(Sheet2[Compliant]) + SUM(Sheet2[Non-Compliant]))

使用表格报告的结果

enter image description here