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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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