使用PBI中的计算创建具有汇总值的列

时间:2018-09-23 17:48:44

标签: aggregate powerbi

假设您有两个表:

表用户: ID, Name

表顺序: ID, UserID

我正在尝试在表User中创建一个新列,其中应包含不同数量Order.IDs的聚合值。

1 个答案:

答案 0 :(得分:1)

计算列:

[
    'class' => AccessControl::className(),
    ...
    'denyCallback' => function ($rule, $action) {
        throw new \Exception('You are not allowed to access this page');
    }
]

或者,如果您在两个表之间没有/没有关系:

OrderCount = CALCULATE(DISTINCTCOUNT(Orders[Id]))

如果只需要以某种可视化方式显示它,则可以通过将OrderCount2 = CALCULATE(DISTINCTCOUNT(Orders[Id]),FILTER(Orders, Orders[UserId] = User[Id])) 侧窗格下Orders[Id]中的聚合选项设置为Count (Distinct)来直接使用Values

相关问题