【问题标题】:How to aggregate another measure in the same PowerPivot table?如何在同一个 PowerPivot 表中聚合另一个度量?
【发布时间】:2013-04-25 08:15:45
【问题描述】:

我的 PowerPivot 表中有一个度量值,它根据同一行中其他度量值的值返回 1 或 0。

我想编写一个新的度量,如果此度量对于数据透视表中的任何行为 1,则返回“总计”1。更一般地说,我想汇总不同度量的行值。如何做到这一点?

(只有总值需要代表这个聚合,每行的计算结果无关紧要。)

使用 MAXX(Table_with_row_descriptors, Expression_that_returns_binary_value) 几乎可以工作,但它会改变 Expression_that_returns_binary_value 的评估,使得对于每一行,结果有时与简单的 Expression_that_returns_binary_value 度量不同,因此在某些情况下,总数是错误的。

【问题讨论】:

  • [Expression_that_returns_binary_value] 是如何工作的?有时,将表达式创建为单独的度量然后在 MAXX 中调用该度量会有所帮助。
  • 一个具体的例子可以帮助我们更好地理解您的问题。能否提供详细信息?

标签: excel powerpivot dax


【解决方案1】:

我的同事找到了解决方案:

IF(HASONEVALUE([row_descriptor]), Expression_that_returns_binary_value, MAXX(values(Table_with_row_descriptors), Expression_that_returns_binary_value)) 

这会检查我们是在评估数据透视表中的正常行还是“总计”行,并且仅在后一种情况下使用 MAXX。

【讨论】:

    猜你喜欢
    • 2021-03-05
    • 2013-07-10
    • 1970-01-01
    • 2019-10-20
    • 2023-02-26
    • 2018-08-12
    • 1970-01-01
    • 2015-11-11
    • 1970-01-01
    相关资源
    最近更新 更多