如何将具有相同ID的行合并到列表中

问题描述:

如何使下表像列表一样.

How can I make the below table like a list.

Id   Name
1    Tim
1    George
2    Rachael
3    Mark
3    Blake

我希望结果像这样

Id    Name
1     Tim,George
2     Rachael
3     Mark,Blake

有什么想法吗?

请尝试以下操作,它可能会解决您的问题.

try the following, it may solve your problem.

假设您现有的表名称为 yourTable ,要创建的新表为 groupedNames .在数据视图中,单击新表并粘贴以下内容:

Let's say your existing table name is yourTable and the new table to be created is groupedNames. in data view, click on new table and paste the following:

groupedNames = calculatetable
(
    addcolumns(
        summarize(yourTable ,yourTable[Id ]),
        "Names",calculate(CONCATENATEX(yourTable,[ Name ],","))
    )   
)