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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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

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

Hope this helps,

David

View solution in original post

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

View solution in original post

3 REPLIES 3
dedelman_clng
Community Champion
Community Champion

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

Hope this helps,

David

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),
    ""
)

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.