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
mcflurry
Helper I
Helper I

Insert multiple characters to string

Hi,

 

I'm trying to insert a few "dots" symbol to a column with a custom column, but i can only get one characte, this worksr:

 

CustomColumn

=Text.Insert(Text.From([Column]),2,".")

 

What if I want to add another dot after the fourth and sixth characters? I've tried a few things withous success, i don't know what's the right syntax, something like this maybe but i can't get it to work:

 

CustomColumn

=Text.Insert(Text.From([Column]),2,".",4,".",6,".")

 

CustomColumn

=Text.Insert(Text.From([Column]),2,4,6,".")

 

 

 

1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @mcflurry 

Add a custom column like :

Column=Text.Insert(Text.Insert([Column1],4,"."),7,".")

Ailsa-msft_0-1620981385691.png

And the effect is as shown:

Ailsa-msft_1-1620981385692.png 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yetao1-msft
Community Support
Community Support

Hi @mcflurry 

Add a custom column like :

Column=Text.Insert(Text.Insert([Column1],4,"."),7,".")

Ailsa-msft_0-1620981385691.png

And the effect is as shown:

Ailsa-msft_1-1620981385692.png 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HashamNiaz
Solution Sage
Solution Sage

Hi !

You should use the following Power Query (M) code to do your transformation for Custom column;

 

Text.Insert(Text.Insert(Text.Insert([Column1],2,"."),5,"."),8,".")

 

Replace CharacterReplace Character

First replacement will be done on 2nd position, now your string has one more character in it, so to replace 4th character in orginal string you need to replace 5th position and similary for 6th caharacter in orignal string you need to replace 8th position

 

Regards,

Hasham

ChrisMendoza
Resident Rockstar
Resident Rockstar

@mcflurry - Like this?

Text.Insert(
	Text.Insert(
		Text.Insert(
			[Column1],
			2,
			"."
		),
		4,
		"."
	),
	6,
	"."
)

image.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



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.