按相同 ID 分组的 Power BI Sum 单元格

编程入门 行业动态 更新时间:2024-10-10 01:18:03
本文介绍了按相同 ID 分组的 Power BI Sum 单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何创建一个公式来汇总具有相同 ID 的所有单元格?

How can I make a formula which sums all the cells which have the same ID?

这两列都在同一个表中.我需要一个新列来计算具有相同 ID 的所有小时的总和.

Both of these columns are in the same table. I need a new column which calculates the sum of all the hours with the same ID.

推荐答案

在这种情况下,我会创建一个新的summery table:

In that case, I would create a new summery table:

SummeryTable = SUMMARIZE( 'TableName'; 'TableName'[ID]; "Time_summed"; SUM('TableName'[TimeColumn]) )

然后,您最终会得到一个表,其中每一行都有不同的 [ID],以及原始数据表中与此 ID 对应的所有小时数的总和.您可以使用它来创建与原始表的关系.

Then you will end up with a table with distinct [ID] on each row and the sum of all hours corresponding to this ID from the original data table. Which you can use to create a relationship with the original table.

EDIT_1:

可以,如果您使用这样的计算列:

Yes you can if you use a calculated column like this:

SumTime = VAR thisID = [ID] RETURN CALCULATE( SUM('TableName'[TimeColumn]); ALL('Tablename'); 'TableName'[ID] = thisID )

更多推荐

按相同 ID 分组的 Power BI Sum 单元格

本文发布于:2023-10-30 07:38:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1542205.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单元格   Power   ID   Sum   BI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!