【问题标题】:Difference between two matrix columns appears two times (Power BI)两个矩阵列之间的差异出现两次(Power BI)
【发布时间】:2019-08-13 15:22:00
【问题描述】:

我用两类数据之间的差异创建了一个新度量;但是当我把它放在一个矩阵中时,这个信息会出现两次。

我有一个这种格式的数据库:

Type    Month   Item    Value
real    1   earnings    10
real    2   earnings    15
real    3   earnings    20
real    4   earnings    10
real    5   earnings    11
ppto    1   earnings    10
ppto    2   earnings    12
ppto    3   earnings    13
ppto    4   earnings    12
ppto    5   earnings    10

然后我创建了一个这样的度量:

Difference =
CALCULATE ( SUM ( BASE[Value] ); BASE[Type] = "real" )
    - CALCULATE ( SUM ( BASE[Value] ); BASE[Type] = "ppto" )

问题是当我将新变量放入矩阵时,我得到了这个(重复两列差异):

但我希望将结果放在一列中。像这样:

我该如何解决这个问题?

【问题讨论】:

    标签: powerbi dax


    【解决方案1】:

    这是因为您在 Columns 字段中有 Tipo 并且它有多个值。

    一种可能的解决方案是从列中删除Tipo 并使用三个度量。

    real = CALCULATE ( SUM ( BASE[Value] ); BASE[Type] = "real" )
    ppto = CALCULATE ( SUM ( BASE[Value] ); BASE[Type] = "ppto" )
    Difference = [real] - [ppto]
    

    【讨论】:

      猜你喜欢
      • 2020-04-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多