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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
EGobi
Frequent Visitor

Capitalize only the first letter of each word based on a culture

Hello,

 

I have a table in which all columns are in capital letters. For data presentation purposes, I want one of them to have only the first letter of each word capitalized. I could use the built-in function in PowerQuery Editor, which would produce the following step:

 

 

Table.TransformColumns(A, {{"B", Text.Proper, type text}})

 

Where A is the table and B is the column name.

 

The problem is that I need the capitalization to follow the settings of my culture (pt-BR), so some words should not be capitalized. Text.Proper has a "culture" argument that works for me, but Table.TransformColumns only accepts a "transformOperations" list of functions, which doesn't seem to support function arguments.

 

So how can I use the Text.Proper "culture" argument inside Table.TransformColumns?

 

Thanks in advance

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @EGobi ,

 

Instead of using Table.TransformColumns, you could use a modified Table.ReplaceValue, something like this:

 

Table.ReplaceValue(
    A,
    each [B],
    each Text.Proper(_, "pt-BR"),
    Replacer.ReplaceValue,  // or Replacer.ReplaceText if this doesn't work
    {"B"}
)

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @EGobi ,

 

Instead of using Table.TransformColumns, you could use a modified Table.ReplaceValue, something like this:

 

Table.ReplaceValue(
    A,
    each [B],
    each Text.Proper(_, "pt-BR"),
    Replacer.ReplaceValue,  // or Replacer.ReplaceText if this doesn't work
    {"B"}
)

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




EGobi
Frequent Visitor

Neat, it worked! Thanks!

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors