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

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
Super User II
Super User II

@Alisea_MI You could try a calculated column such as 

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

Respectfully,
DataZoe


See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

2 REPLIES 2
Alisea_MI
Advocate I
Advocate I

Thank you so much, @DataZoe ! Works perfect!

DataZoe
Super User II
Super User II

@Alisea_MI You could try a calculated column such as 

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

Respectfully,
DataZoe


See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors