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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

building strings

Hello Community,

 

i'm trying to build an email from a colmun with full names. Right now i'm using substitute to replace all blank spaces with a dot and then i add the domain name. But since there are people working here with three names i need to add a underscore before the third name, like this: john.donothan_wayne@outlook.com. Is there any way to iterate through the string or any other ways yoou can suggest?

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can use a third argument in SUBSTITUE to dictate the occurance that you want to substitue =SUBSTITUTE([name]," ","_",2)

 

I'd use a switch that checks the number of time a space occurs  LEN([name])-LEN(SUBSTITUTE([name]," ","")) then have a result for 1 space or 2.

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Alternatively I'd build a custom column in the query editor that splits on the spaces in the names, split on space then concatenate them together with 2 custom columns will probably be the easiest way to do it, might not be the most efficient though.

Anonymous
Not applicable

You can use a third argument in SUBSTITUE to dictate the occurance that you want to substitue =SUBSTITUTE([name]," ","_",2)

 

I'd use a switch that checks the number of time a space occurs  LEN([name])-LEN(SUBSTITUTE([name]," ","")) then have a result for 1 space or 2.

 

 

Anonymous
Not applicable

Oh wow that was more easy then i thought, i used the Substitute solution with the second argument and that fullfills my needs. Thanks!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors