Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MDEL
Regular Visitor

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

 

PDD_CMBIND.JPGPWHDD.JPG

1 ACCEPTED SOLUTION

@MDEL,

Create a column as shown in the following screenshot.

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

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
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

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. 




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

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lydia

I want PDD and WHDD values to be copied to the new field as it is please see example below

Name          PDD          WHDD         NEW Field

Raw1            658                               658

Raw2            5685                             5685

Raw3            699                               699

Raw4                            257               257

Raw5                            123                123

Raw6                             666               666

 

New Field contains both values from PDD and WHDD

 

@MDEL,

Create a column as shown in the following screenshot.

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

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.