[英]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.