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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. 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
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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