cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alisea_MI
Resolver I
Resolver 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
Microsoft
Microsoft

@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
Resolver I
Resolver I

Thank you so much, @DataZoe ! Works perfect!

DataZoe
Microsoft
Microsoft

@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/

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors