【问题标题】:How I can find percentage out of subtotals with multiple columns in Pivot table如何在数据透视表中的多列小计中找到百分比
【发布时间】:2019-06-05 12:54:41
【问题描述】:

如何在数据透视表中的多列小计中找到百分比。

PercentYes :=
    CALCULATE ( SUM ( MyTable[value] ), MyTable[answers] = "yes" ) /
    CALCULATE (
        SUM ( MyTable[value] ),
        ALL ( MyTable[subcategory], MyTable[answers] )
    )

【问题讨论】:

    标签: excel pivot-table dax powerpivot


    【解决方案1】:

    我创建了一个值样本

    我将首先创建一个总和度量:

    Sum of Values:=SUM(MyTable[Value])
    

    然后,我将创建百分比度量:

    Percent of Values :=
    DIVIDE (
        [Sum of Values],
        CALCULATE (
            [Sum of Values],
            ALL ( MyTable[Subcategory],MyTable[Answers] )            
        )
    )
    

    使用 DIVIDE 将有助于解决在分母中捕获零的错误。结果如下所示:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-09
      • 2018-06-24
      • 2016-09-06
      • 2019-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多