You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何基于Power BI中UNION结果的Number列获取唯一行

在Power BI中对合并后的表去重(保留唯一Name+Number行)

你可以通过在原合并公式外层嵌套DISTINCT函数实现去重,它会自动移除表中完全重复的行(即Name和Number组合完全一致的行),修改后的DAX公式如下:

ResultTable = 
DISTINCT(
    UNION (
        SELECTCOLUMNS (
            'Table1',
            "Name", 'Table1'[name] ,
            "Number", 'Table1'[number]
        ) ,
        SELECTCOLUMNS (
            'Table2',
            "Name", 'Table2'[name] ,
            "Number", 'Table2'[number]
        )
    )
)

执行后得到的ResultTable将保留唯一的Name+Number组合行,结果如下:

NameNumber
A1
A2
A3
C5
B4

内容的提问来源于stack exchange,提问作者n179911a

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 04:15:31