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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

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

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

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

@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

Anonymous
Not applicable

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. 

@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

Anonymous
Not applicable

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

@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

@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
Anonymous
Not applicable

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 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