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

编程入门 行业动态 更新时间:2024-10-10 03:24:10
本文介绍了按相同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.

推荐答案

在这种情况下,我将创建一个新的夏季表:

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

发布评论

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

>www.elefans.com

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