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
Alisea_MI
Advocate III
Advocate III

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
Employee
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
Advocate III
Advocate III

Thank you so much, @DataZoe ! Works perfect!

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