Forum Discussion

mhdilyas's avatar
mhdilyas
Frequent Visitor
3 years ago
Solved

combine specifc column from different table

we have imported data from diffirent data source, all data table have one common column and want to append specific not all.

 

Table1, table2, table 3

cul1, col2, cul3

append to new table in column

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi mhdilyas ,

    You just need modify the dax formula:

     

    Table 4 =
    VAR tmp1 =
        DISTINCT ( 'Table'[Product] )
    VAR tmp2 =
        DISTINCT ( 'Table 2'[Product] )
    VAR tmp3 =
        DISTINCT ( 'Table 3'[Product] )
    VAR tmp4 =
        SELECTCOLUMNS ( tmp1, "P1", [Product] )
    VAR tmp5 =
        SELECTCOLUMNS ( tmp2, "P2", [Product] )
    VAR tmp6 =
        SELECTCOLUMNS ( tmp3, "P3", [Product] )
    VAR tmp7 =
        UNION ( tmp4, tmp5, tmp6 )
    VAR tmp8 =
        FILTER ( tmp7, [P1] <> BLANK () )
    RETURN
        SELECTCOLUMNS ( tmp8, "Product", [P1] )
    

     

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mhdilyas ,

    Please try below steps:

    1. below is test table

    Table:

    Table2:

    Table3:

     

    2. create a table with below dax formula

    Table 4 =
    VAR tmp1 =
        SELECTCOLUMNS ( 'Table', "P1", [Product] )
    VAR tmp2 =
        SELECTCOLUMNS ( 'Table 2', "P2", [Product] )
    VAR tmp3 =
        SELECTCOLUMNS ( 'Table 3', "P3", [Product] )
    VAR tmp4 =
        UNION ( tmp1, tmp2, tmp3 )
    RETURN
        SELECTCOLUMNS ( tmp4, "Product", [P1] )
    

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • mhdilyas's avatar
      mhdilyas
      Frequent Visitor

      It did work thanks for support.

      How to remove doublicate value and emply column

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi mhdilyas ,

        You just need modify the dax formula:

         

        Table 4 =
        VAR tmp1 =
            DISTINCT ( 'Table'[Product] )
        VAR tmp2 =
            DISTINCT ( 'Table 2'[Product] )
        VAR tmp3 =
            DISTINCT ( 'Table 3'[Product] )
        VAR tmp4 =
            SELECTCOLUMNS ( tmp1, "P1", [Product] )
        VAR tmp5 =
            SELECTCOLUMNS ( tmp2, "P2", [Product] )
        VAR tmp6 =
            SELECTCOLUMNS ( tmp3, "P3", [Product] )
        VAR tmp7 =
            UNION ( tmp4, tmp5, tmp6 )
        VAR tmp8 =
            FILTER ( tmp7, [P1] <> BLANK () )
        RETURN
            SELECTCOLUMNS ( tmp8, "Product", [P1] )
        

         

         

        Best regards,
        Community Support Team_Binbin Yu
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Explain issue, you want to append new table which is also having common column but you do not want all columns only specific columns?

     

  • Arul's avatar
    Arul
    Icon for Super User rankSuper User

    mhdilyas ,

    Your explanation to the requirement is not clear. Could you please provide more context on this?

    Thanks,

    Arul