Forum Discussion

kens8's avatar
kens8
Frequent Visitor
3 years ago
Solved

Unmatching elements from 2 columns from 2 different tables

Hello, this is the situation. I have 2 tables that I linked on the column that that (normally) contain unique elements. It is supposed to be the sama in both tables but in either tables, there are e...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  kens8 ,

     

    Here are the steps you can follow:

    1. Create calculated column.

    Table =
    var _column1=
    SELECTCOLUMNS('Table2',"table2",[Flag])
    var _column2=
    SELECTCOLUMNS('Table1',"table1",[Flag])
    var _table1=SELECTCOLUMNS(
        FILTER(ALL('Table1'),
        NOT('Table1'[Flag]) in _column1),"flag",'Table1'[Flag])
    var _table2=
    SELECTCOLUMNS(
        FILTER(ALL('Table2'),
        NOT('Table2'[Flag]) in _column2),"flag",'Table2'[Flag])
    return
    UNION(
        _table1,_table2)

    2. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly