Forum Discussion

MDEL's avatar
MDEL
Regular Visitor
8 years ago
Solved

Combine two columns in the same table

Hi All, 

Thanks for the help, 

I have 2 columns both contains 'Dates' for different category. I need to create new column to combine both columns and be able to query the data using the new column.

PDD column and P_WHDD to be combined in Combined Column

 

  • Anonymous's avatar
    Anonymous
    8 years ago

    MDEL,

    Create a column as shown in the following screenshot.

    Column = IF(ISBLANK(YourTable[WHDD]),YourTable[PDD],YourTable[WHDD])



    Regards,
    Lydia

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Not sure about your table structure, If you just want to combine these 2 columns , then you can do "Append" in  Power Query Home -> Combine-> Append Queries.

     

    If you want to do it in DAX, UNION function will help you.

     

    If you are  expecting more specilized solution then please share more details.

     

    Thanks

    Raj

    • MDEL's avatar
      MDEL
      Regular Visitor

      Hi Rajendran

      Thanks for the response, 

      PDD column have Dates for some records

      WHDD column have Dates for different records

      I want to combine both columns into one column to be able to query the Data using the combined column.

      the table contains 65 columns and thousands of records. 

      • Anonymous's avatar
        Anonymous
        Not applicable




        PDD column have Dates for some records

        WHDD column have Dates for different records

        I want to combine both columns into one column to be able to query the Data using the combined column.

        the table contains 65 columns and thousands of records. 


        MDEL,

        Are PDD column and WHDD column in same table? If so, what logic do you use to create the new combine column(e.g. if PDD column is greater than WHDD, then combine column should be equal to PDD column, otherwise, it should be equal to WHDD column)?

        Regards,
        Lydia