cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rpattan
Advocate I
Advocate I

Concatenate two column rows based on a particular string

Hi Team,

 

Could you look into the need. 

 

I'm looking for a DAX for a new concated column calculating from column "ID" and column "Name", and concatenated based on expected string of "BC" from column "Type". And the rest of the rows should be null. Please observe two tables for clear understanding...

 

Actual Data Table:

TypeIDName
AB123Compensation
BC345Variable Pay
CD127SPHR
BC379Learning
AB456Onboarding
BC497Performance
CD230Goals
DC107Succession

 

Expected Data Table:

TypeIDNameExpected Concated Column
AB123Compensation 
BC345Variable Pay345Variable Pay
CD127SPHR 
BC379Learning379Learning
AB456Onboarding 
BC497Performance497Performance
CD230Goals 
DC107Succession 

 

Thank you for your time and patience.

 

RK

2 ACCEPTED SOLUTIONS
dedelman_clng
Super User
Super User

ConcatCol = 
IF (
    Type = "BC", 
    CONCATENATE(ID, Name),
    ""
)

Hope this helps,

David




Proud to be a Super User!




View solution in original post

IF (
    OR(Type = "BC", Type = "AB")
    CONCATENATE(ID, Name),
    ""
)



Proud to be a Super User!




View solution in original post

3 REPLIES 3
dedelman_clng
Super User
Super User

ConcatCol = 
IF (
    Type = "BC", 
    CONCATENATE(ID, Name),
    ""
)

Hope this helps,

David




Proud to be a Super User!




View solution in original post

Hello @dedelman_clng,

 

It's worked to my requirement. 

 

And just perhaps if I woul'd like to go with "BC" + "AB" (Just in case!)

 

Thanks in Advance...

RK

IF (
    OR(Type = "BC", Type = "AB")
    CONCATENATE(ID, Name),
    ""
)



Proud to be a Super User!




View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!