Forum Discussion

ScorpionKing's avatar
ScorpionKing
Frequent Visitor
8 years ago

How to combine two columns from the same table

Hi everyone! Pls help me combine two columns from the same table as shown below.

 

Thanks in advance!

 

5 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Hi ScorpionKing

     

    Go to Modelling Tab ... and select the NEW TABLE button

     

    NEW Table =
    UNION (
        SELECTCOLUMNS (
            TableName,
            "Location", TableName[Location],
            "Reason Code", TableName[Unserved Code],
            "Quantity", TableName[Qty]
        ),
        SELECTCOLUMNS (
            TableName,
            "Location", TableName[Location],
            "Reason Code", TableName[Return Code],
            "Quantity", TableName[Qty1]
        )
    )