Reply
avatar user
Anonymous
Not applicable
Partially syndicated - Outbound

How to use Text Function to keep the Acronyms in capital and rest of the words in small letters

Hi memebers, 

 

I have a situation, 

 

I have a list of company names, thats all mixed: 

 

Like this: 

1.  ABC DONAWAN 

2.  XYZ

3.  John Smith

 

the out put i want is:

 

1. ABC Donawan

2.  XYZ

3. John Smith 

 

How can I get this outcome? if I try "Capitalize each word" in M Query, then XYZ becomes Xyz, but XYZ is an acronym and i want it to stay capital. 

Can someone please help. 

Thanks in advance. 🙂 

 

regards

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Syndicated - Outbound

Hi @Anonymous ,

 

According to your needs, you can try to use the upper and lower functions. Their function is to convert the letters specified in Text into upper and lower case. I did a test. Refer to the following:

col_N =
UPPER ( LEFT ( [susanne], 1 ) )
    & LOWER ( RIGHT ( [susanne], LEN ( [susanne] ) - 1 ) )


Best Regards,
Henry


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

8 REPLIES 8
v-henryk-mstf
Community Support
Community Support

Syndicated - Outbound

Hi @Anonymous ,

 

According to your needs, you can try to use the upper and lower functions. Their function is to convert the letters specified in Text into upper and lower case. I did a test. Refer to the following:

col_N =
UPPER ( LEFT ( [susanne], 1 ) )
    & LOWER ( RIGHT ( [susanne], LEN ( [susanne] ) - 1 ) )


Best Regards,
Henry


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

Fowmy
Super User
Super User

Syndicated - Outbound

@Anonymous 

How do you identify which part is the acronym when they are mixed?

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

avatar user
Anonymous
Not applicable

Syndicated - Outbound

Hi, it just makes sense looking at the data. 
for example if a customer name is: AHI Roofing, then AHI is the acronym. Usually customer names have an acronym and then a word that makes sense. 

Syndicated - Outbound

@Anonymous 

 

So if the 1st word is in all capitals then the rest should be converted to sentence case right?

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

avatar user
Anonymous
Not applicable

Syndicated - Outbound

hi, 

this is a good example: 

Gumdrop_0-1627505991983.png

 Output:

Dixon & Haddon

Pegasus Industrial Engineering Ltd

E R Freeman Ltd - Corporate

Allwin Steel Enterprises

 

 

Hope that makes more sense. 

Regards

amitchandak
Super User
Super User

Syndicated - Outbound

@Anonymous , Try like this , a new column in power query

 

List.First(Text.Split([column]," "))  &  " "  & Text.Proper(Text.Combine(List.LastN(Text.Split([column]," "),List.Count(Text.Split([Column])) -1) ," "))

 

 

or like

 

Text.Combine( {  

List.First(Text.Split([column]," "))  ," "  ,Text.Proper(Text.Combine(List.LastN(Text.Split([column]," "),List.Count(Text.Split([Column])) -1) ," "))

})

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

Syndicated - Outbound

@Anonymous , what is the difference between data and output. Somehow I am not clear

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
avatar user
Anonymous
Not applicable

Syndicated - Outbound

My bad, 

 

I made a mistake and have now edited my original query. 

 

But here is what i want: 

Like this: 

1.  ABC DONAWAN 

2.  XYZ

3.  John Smith

 

the out put i want is:

 

1. ABC Donawan

2.  XYZ

3. John Smith 

 

Regards

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)