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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mmarchioni
Helper I
Helper I

Add Prefix to only rows in column with text

I have a column where I would like to add a prefix to only those rows that have text.

 

What I have:

24

Blank

10

12

Blank

 

What I get when I add the prefix:

A24

A

A10

A12

A

 

What I want:

A24

Blank

A10

A12

Blank

 

I would like to keep the blank rows blank.

Could you please provide some guidance?

1 ACCEPTED SOLUTION

You have updated your comment 🙂

Anyways you can try below approch:-

A2with_prefix =
IF (
    Trim(rvTX[Related Patient.A2Cd]) <> BLANK(),
    "A" & rvTX[Related Patient.A2Cd],
    BLANK()
)

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

8 REPLIES 8
mmarchioni
Helper I
Helper I

I still ended up with an A in the Blank rows.

Could you please share what you have tried and what output you are getting? 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

I created a column with

 

A2with_prefix =
IF ( NOT ( ISBLANK ( rvTX[Related Patient.A2Cd] ) ), "A" & rvTX[Related Patient.A2Cd], BLANK () )
 
And still got A's in the rows that were blank. The columns are formatted as text and not numbers (I am not sure if that makes a difference).

Based on your requirement your code would be like this:-

A2with_prefix =
IF (
    NOT ( ISBLANK ( rvTX[Related Patient.A2Cd] ) ),
    "A" & rvTX[Related Patient.A2Cd],
    BLANK()
)

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

That is what I tried.

You have updated your comment 🙂

Anyways you can try below approch:-

A2with_prefix =
IF (
    Trim(rvTX[Related Patient.A2Cd]) <> BLANK(),
    "A" & rvTX[Related Patient.A2Cd],
    BLANK()
)

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Works great! Thanks!

Samarth_18
Community Champion
Community Champion

HI @mmarchioni ,

You can create column with below code:-

with_prefix =
IF ( NOT ( ISBLANK ( prefix[Column1] ) ), "A" & prefix[Column1], BLANK () )

 

image.png

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.