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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

How to limit the amount of characters in a field of a table?

I have a field in a certain table that most records have more than 20 characters each, and I need to use only the first 15, how can I do?

 

Obs: I tried to use the strokes to divide the column by characters but some characters disappeared with this as you can see in the pictures

 

Untitled.pngUntitled1.png

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@Anonymous

 

Hi,

 

 

You can Use Extract--First Characters--and Enter 15.

 

You can find this action in Transform or Add Column

 

Let me know if works.

 

Regards

 

 




Lima - Peru

View solution in original post

3 REPLIES 3
v-sihou-msft
Microsoft Employee
Microsoft Employee

@Anonymous

 

To get fixed length of text from a text column, you can use Extract as @Vvelarde suggested, this will add a Power Query step in Query Editor like:

 

#"Inserted First Characters" = Table.AddColumn(#"Changed Type", "First Characters", each Text.Start(Text.From([Project Name], "en-US"), 15), type text)

Or you can add a calculated column and use DAX to achieve your goal.

 

 

First 15 = LEFT(Table[Column],15)

Regards,

 

Vvelarde
Community Champion
Community Champion

@Anonymous

 

Hi,

 

 

You can Use Extract--First Characters--and Enter 15.

 

You can find this action in Transform or Add Column

 

Let me know if works.

 

Regards

 

 




Lima - Peru
Anonymous
Not applicable

hi, for my problem I have a colum with variety character length. Some are 13, letters, some are 10 and such. So I only want to extract the first 8 characters from a 13 letters character. However on the add custom column it says it cannout found the LEN or len, but no syntax error whatsoever. How do I solved this?

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.