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

Viewed 58

On Power BI, I have values from two tables. And I would like to create a new table where has the distinct values list in one column from both tables For example:

Table1:

Column A
-------------
aaa
bbb
ccc
ddd
eee

Table2:

Column_B
-------------
ddd
eee
fff
fff
ggg

New table

Appended_columnA.B
------------------
aaa
bbb
ccc
ddd
eee
fff
ggg
2 Answers

This should be done in Power Query unless you also need to load the two source tables in your model. EG

let
    #"Appended Query" = Table.Combine({#"Table1", #"Table2"}),
    #"Removed Duplicates" = Table.Distinct(#"Appended Query")
in
    #"Removed Duplicates"
New Table = 
DISTINCT(
    UNION(
        SELECTCOLUMNS(Table1, "a", Table1[Column A]),
        SELECTCOLUMNS(Table2, "a", Table2[Column_B])
    )
)
Related