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

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
PowerUserR
Solution Supplier
Solution Supplier

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

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
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.