Merge tables in Power Apps

Home Power Apps Merge tables in Power Apps

Merging tables in Power BI can easily be done by using the functions for that purpose in the M and/or DAX language. See the blog post I wrote on that topic here. Power Apps does not offer these functions, so we have to merge tables by using Power Fx, the language used for programming in (among others) Power Apps.

Here is an overview of the joins in Power Apps and the Power Fx code. The tables used in this example are:


Icon

M

Power Apps Power Fx

Left Outer

AddColumns(

    Table1,

    "Value.1",

    LookUp(

        Table2,

        Title = Table1[@Title],

        Table2[@Value]

    )

)


Left Anti

Filter(

    AddColumns(

        Table1,

        "Value.2",

        LookUp(

            Table2,

            Title =
Table1[@Title],

            Table2[@Value]

        )

    ),

    IsBlank('Value.2')

)


Inner

Filter(

    AddColumns(

        Table1,

        "Value.2",

        LookUp(

            Table2,

            Title =
Table1[@Title],

            Table2[@Value]

        )

    ),

    Not(IsBlank('Value.2'))

)


 Full Outer

Ungroup(

    Table(

        {

            MyTables:Filter(

                AddColumns(

                    Table1,

                   
"Value.1",

                    LookUp(

                        Table2,

                        Title =
Table1[@Title],

                        Table2[@Value]

                    )

                ),

               
IsBlank('Value.1')

            )

        },

        {

            MyTables:
AddColumns(

                Table2,

               
"Value.1",

                LookUp(

                    Table1,

                    Title =
Table2[@Title],

                   
Table1[@Value]

                )

            )

        }

    ),

    "MyTables"

)