Forum Discussion

Pioneer's avatar
Pioneer
Regular Visitor
3 years ago
Solved

How to combine two columns dates into one column

Hi,

How to combine two dates columns of a table  into one  new column .please check below sample data for reference.

 

 

expecting output:

 

Sample excelreport:

In_Date                     Out_date                 
01-11-201420-08-1999
15-04-199819-01-1998
16-11-2022 
20-08-199921-08-1999
21-01-200120-09-1993
21-09-199421-01-2001
30-01-199701-11-2014

 

Thanks,

Pioneer

 

  • Hi, Pioneer 

     

    This can only be done in Power Query.

    Copy two more tables, delete one of the columns from each table, change the column names to [In and Out date] and use Append.

    Select Remove duplicates.

    Join the initial table and the Append table to the right.

    Result:

    Click in the top right corner to expand.

    Is this the result you expect?

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

10 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Pioneer ,

     

    What is the logic you follow to get the combine column?

    • Pioneer's avatar
      Pioneer
      Regular Visitor

      Hi Anonymous,

      Iam looking for the Dax logic to achieve the expected output column in the same table.

       

      Thanks,

      Pioneer

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Yes, but its needed to know the logic how you want obtain the output column,

         

        is In_date at top and Out_date at bottom and remove duplicates?

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Pioneer 

     

    You can try the following methods.
    New Table:

    Table 2 = DISTINCT(UNION(VALUES('Table'[In_Date]),VALUES('Table'[Out_date])))

    Is this the result you expect?

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Pioneer's avatar
      Pioneer
      Regular Visitor

      Hi v-zhangti ,

       

      Thanks for reply , My requirement is to create another column in the same table instead of creating  new table.

      that New  column should able to use in slicer  visual aswell.

       

      Thanks,

      Pioneer

      • v-zhangti's avatar
        v-zhangti
        Icon for Community Support rankCommunity Support

        Hi, Pioneer 

         

        This can only be done in Power Query.

        Copy two more tables, delete one of the columns from each table, change the column names to [In and Out date] and use Append.

        Select Remove duplicates.

        Join the initial table and the Append table to the right.

        Result:

        Click in the top right corner to expand.

        Is this the result you expect?

        Best Regards,

        Community Support Team _Charlotte

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.