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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Prabhu11
Frequent Visitor

Create new column having the values of existing 2 columns

Hi Community,

 

I want to create a column with the values of Column 1 and Column 2 as column 3,

How can I achieve this, kindly help

 

Column 1Column 2 Column 3
A0A
B0B
0CC
000
0DD

 

Regards

Prabhu

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Oh okay, my bad!
here is a solution to that:

Outcome = SWITCH(TRUE(),
'Table (2)'[Column1] = "0" && 'Table (2)'[Column2]="0", 'Table (2)'[Column1],
'Table (2)'[Column1]="0" && 'Table (2)'[Column2] <>"0", 'Table (2)'[Column2],
'Table (2)'[Column1] <> "0" && 'Table (2)'[Column2] ="0", 'Table (2)'[Column1])



View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi,
By combining, do you mean concatinating?
Then you can use: 

Combined = 'Table'[Column 1] & " " & 'Table'[Column 2] & " " & 'Table'[Column 3]

Hi, I don't need to concatenate, I trying to achieve through the condition

 

i.e If Column 2 has value then return the value of Column 2 else return the value of Column 1 in the final Column 3

Anonymous
Not applicable

Oh okay, my bad!
here is a solution to that:

Outcome = SWITCH(TRUE(),
'Table (2)'[Column1] = "0" && 'Table (2)'[Column2]="0", 'Table (2)'[Column1],
'Table (2)'[Column1]="0" && 'Table (2)'[Column2] <>"0", 'Table (2)'[Column2],
'Table (2)'[Column1] <> "0" && 'Table (2)'[Column2] ="0", 'Table (2)'[Column1])



Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors