powerbi - 两个矩阵列之间的差异出现两次(Power BI)
问题描述
我用两类数据之间的差异创建了一个新的度量;但是当我把它放在一个矩阵中时,这个信息会出现两次。
我有一个这种格式的数据库:
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" )
问题是当我将新变量放入矩阵时,我得到了这个(重复两列差异):
但我想在一列中得到结果。像这样:
我怎样才能解决这个问题?
解决方案
这是因为您Tipo
在该Columns
字段中有多个值。
一种可能的解决方案是Tipo
从列中删除并使用三个度量。
real = CALCULATE ( SUM ( BASE[Value] ); BASE[Type] = "real" )
ppto = CALCULATE ( SUM ( BASE[Value] ); BASE[Type] = "ppto" )
Difference = [real] - [ppto]
推荐阅读
- mongodb - 通过替换值更新多个字段值 MongoDB
- java - 如何在 Seekbar 上放置箭头作为选择器
- css - CSS动画高CPU使用率
- pandas - 给定熊猫数据框中列的不同值,如何从多行/列创建列表?
- jquery - click vs keydown 页面重新加载问题
- javascript - 使用 each-in 循环后无法在输入 ember 中操作对象模型
- c - 以状态 3 SDL 结束的程序
- angular - id 在 angular-in-memory-web-api 中应该是可选的
- javascript - 有没有办法检测实际的 DOM 渲染何时完成?
- export - DialogFlow 导出说明