Forum Discussion

madji's avatar
madji
Helper I
9 years ago
Solved

loading

I am new in PW BI, Could you help me?    For exemple ( simple) I have 2 tables loading:   1.   A B 1 1 2 2 3 3   2. A D 2 5 3 6 4 7   I try to get ta...
  • Eric_Zhang's avatar
    9 years ago

    madji

    You could either try PowerQuery or DAX, see below sample and attached pbix file.

    let
        SelectAndRenameColumnsFromTable1 = Table.RenameColumns(Table.SelectColumns(Table1,{"A","B"}),{"B","C"}),
        SelectAndRenameColumnsFromTable2 = Table.RenameColumns(Table.SelectColumns(Table2,{"A","D"}),{"D","C"}),
        CombineAboutTwo = Table.Combine({SelectAndRenameColumnsFromTable1,SelectAndRenameColumnsFromTable2})
    in
        CombineAboutTwo
    combinedTableInDax =
    UNION (
        SELECTCOLUMNS ( Table1, "A", Table1[A], "C", Table1[B] ),
        SELECTCOLUMNS ( Table2, "A", Table2[A], "C", Table2[D] )
    )