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

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

Reply
Alisea_MI
Resolver II
Resolver II

Conditional Substring

Hi,

 

I need to set up a conditional column, which looks at the first three characters in a text column and if the third character is " ", it should return the first two characters, else "null".

Example: ZW BY 34 should return ZW.  SSRS 43 YT should return "null". 

 

Would be grateful for any input on this!

1 ACCEPTED SOLUTION
DataZoe
Microsoft Employee
Microsoft Employee

@Alisea_MI You could try a calculated column such as 

Substring = 
IF (
MID ( Customer[Name] , 3, 1 ) = " ",
LEFT ( Customer[Name] , 2 ),
BLANK ()
)

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

2 REPLIES 2
Alisea_MI
Resolver II
Resolver II

Thank you so much, @DataZoe ! Works perfect!

DataZoe
Microsoft Employee
Microsoft Employee

@Alisea_MI You could try a calculated column such as 

Substring = 
IF (
MID ( Customer[Name] , 3, 1 ) = " ",
LEFT ( Customer[Name] , 2 ),
BLANK ()
)

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors