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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Babinsky
Helper I
Helper I

How to find a single character from a field and then create a new field

Hi all, I have a question for you.  

 

Do you know what the IF statement would be to find a single character from a field to create a new field?

 

For example:  When field A contains 'T' then create field B.  The field A is a text field for example T142536, S18273 etc...

 

I am trying to create a new field if the search criteria = T within field A

 

- Babinsky

1 ACCEPTED SOLUTION

Hi @Babinsky,

 

Great to hear the problem got resolved! Could you accept the corresponding reply as solution to help others who may have similar issue easily find the answer and close this thread?Smiley Happy

 

Regards

View solution in original post

12 REPLIES 12
paulag
Advocate I
Advocate I

how about using the left function

=if(left(Field A,1)="T",Field A,"")

temp.png

Thanks for the suggestions but they didn't work.  I found the solution if anyone is curious.

 

SELECT * FROM file

WHERE field1 LIKE 'T%';
 
That created the new field I wanted that contained the value T.
Sean
Community Champion
Community Champion

Okay then! Smiley Happy

Did that work for you?  I did it in Excel Power Query just to test it.  I can do a screen grab in PBI desktop if you want

Yes it did work, Have a great day everyone!

 

- Babinsky

Hi @Babinsky,

 

Great to hear the problem got resolved! Could you accept the corresponding reply as solution to help others who may have similar issue easily find the answer and close this thread?Smiley Happy

 

Regards

Done

Sean
Community Champion
Community Champion

I'm assuming you want a new COLUMN

 

Give this a Try

 

New Column =
IF (
    ISERROR ( FIND ( "T", Table[Column], 1 ) ),
    "No there's no T",
    "Yes there is a T"
)

Hope this helps.

Good Luck!Smiley Happy

I saw your reply thanks!

 

New Column = IF ( ISERROR ( FIND ( "T", Table[Column], 1 ) ), "No there's no T", "Yes there is a T" )

 

Is the following syntax standard?  "No there's no T", "Yes there is a T"

 

It doesn't look like normal coding procedures.  I trying to create a new field based on the contents another.

Sean
Community Champion
Community Champion

The question was: "Do you know what the IF statement would be to find a single character from a field to create a new field?"

 

My Normal Coding Procedures do not include reading minds. But you can output whatever you want

 

Find Function.png

 

Thanks for offering a suggestion.  this is getting me closer sorry for not being clear.

 

What I'm looking to create is for Example - Field1 contains ex: T000 and S000 and I want to create a new field with T000 only.

 

Not create a Yes or No value.

Sean
Community Champion
Community Champion

Do you want a New Column or a New Table?

 

This will give you the new COLUMN like in my picture above

 

New Column =
IF (
    ISERROR ( FIND ( "T", Table[Column], 1 ) ),
    BLANK(),
    Table[Column]
)

 Find Function2.png

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.