简体   繁体   English

Power BI - 我如何将两个表中的两列 append 合并为具有不同值的一列

[英]Power BI - How do I append two columns from two tables into one column with distinct values

On Power BI, I have values from two tables.在 Power BI 上,我有两个表中的值。 And I would like to create a new table where has the distinct values list in one column from both tables For example:我想创建一个新表,其中在两个表的一列中都有不同的值列表 例如:

Table1:表格1:

Column A A栏


aaa啊啊啊

bbb bbb

ccc ccc

ddd ddd

eee eee

Table2:表2:

Column_B列_B


ddd ddd

eee eee

fff fff

fff fff

ggg ggg

New table新表

Appended_columnA.B附加的_columnA.B


aaa啊啊啊

bbb bbb

ccc ccc

ddd ddd

eee eee

fff fff

ggg ggg

New Table = 
DISTINCT(
    UNION(
        SELECTCOLUMNS(Table1, "a", Table1[Column A]),
        SELECTCOLUMNS(Table2, "a", Table2[Column_B])
    )
)

You have to create a New Table using the following DAX expression:您必须使用以下 DAX 表达式创建一个New Table

New Table = DISTINCT(UNION('Table1', 'Table2'))

This should be done in Power Query unless you also need to load the two source tables in your model.这应该在 Power Query 中完成,除非您还需要在 model 中加载两个源表。 EG例如

let
    #"Appended Query" = Table.Combine({#"Table1", #"Table2"}),
    #"Removed Duplicates" = Table.Distinct(#"Appended Query")
in
    #"Removed Duplicates"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Power Bi 中的 Power Query 编辑器从两列的不同值的选择中创建新列 - How to create a new column from the select of the distinct values of two columns with Power Query Editor in Power Bi 从不同表的两列中添加列Power BI - Add Column Power BI from two column of different tables DAX/Power BI:如何有条件地在两列(或更多列)上过滤不同的行? - DAX/Power BI: How can I filter distinct rows conditionally on two (or more) columns? 在矩阵中创建列,该列是Power BI中其他两个列的值的比率 - Create column in matrix that is a ratio of the values of two other columns in Power BI 电源 BI。 一列下两列矩阵 - Power BI. Matrix two columns under one column Power Bi 比较两个表并获取不符合条件的值 - Power Bi Compare two tables and get values that do not matched criteria 在 Power BI 中对两列进行分组后创建一列值总和 - Create a column of sum of values after grouping two columns in Power BI 如何在 Power BI Desktop 中的 DAX 中创建一个具有不同值的计算表 - how to create a calculated table having distinct values from one column in DAX inside Power BI Desktop 在 Power BI Measure 中按其他两个表中的值筛选表 - Filter Table by Values from two other tables in Power BI Measure 通过比较来自不同 Power 查询表的两列,然后可能应用筛选器 (Power BI),在表视觉对象中添加一列 - Add a column in a table visual by comparing two columns from different power query tables and then possibly apply a filter (Power BI)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM