Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
how can I can transform (proper case) of all column in first rows of the table in Power Query
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Solved! Go to Solution.
Example for the first 2 rows:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8nD18fFX0lEK9w/ycVGK1YlWSi1LLaosycjMSwcKp2XmpdqDhfNSy4H8ovxyMC8xL78kI7UIJhILAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]), Typed = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}), ProperCaseFirst2Rows = Table.TransformColumns(Table.FirstN(Typed,2),{}, Text.Proper) & Table.Skip(Typed,2) in ProperCaseFirst2Rows
Example for the first 2 rows:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8nD18fFX0lEK9w/ycVGK1YlWSi1LLaosycjMSwcKp2XmpdqDhfNSy4H8ovxyMC8xL78kI7UIJhILAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]), Typed = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}), ProperCaseFirst2Rows = Table.TransformColumns(Table.FirstN(Typed,2),{}, Text.Proper) & Table.Skip(Typed,2) in ProperCaseFirst2Rows
Are you using {} empty list (highligted in red) to account for the second argument in Table.TransformColumns () ? Or there is another logic here ? Is this by the way an empty list or a full list since function applies to all the values ?
Table.TransformColumns( Table.FirstN(Typed,2), {}, Text.Proper )
Thanks
The {} is an empty list.
In this case it means that no transform operations are supplied as the second argument.
Instead, the 3rd argument is supplied, being the default Transformation function. i.e. the default operation that applies to the columns for which no specific transform operations are specified in the second argument.
Thanks for the answer.
I have a question on transformOperations what arguemnts does it take in its list?
In the example, provided in the formula reference Table.TransformColumns second argument (The list of transformOperations to run) converts text column to number.
So, when we see transformOperations should we assume that it takes {column to change, function} ? ( or as it shown in the example {"A", Number.FromText} )
Table.TransformColumns( Table.FromRecords({[A="1", B=2], [A="5", B=10]}), {"A", Number.FromText}
) equals Table.FromRecords({[A=1,B=2], [A=5,B=10]})
Argument Description
table | The Table to modify. |
transformOperations | The list of transformOperations to run. |
optional defaultTransformation | The default table transformation. |
optional missingField | Missing field value. |
Almost.
There is another, optional, third argument, in which you can specify the resulting column data type.
This information is not available in any docuentation I could find, but if you use standard menu options on the Transform tab, then the generated code includes that third argument, e.g. after chosing menu option Date - Month - End Of Month:
= Table.TransformColumns(Typed,{{"Date", Date.EndOfMonth, type date}})
I'm not sure if that third argument is always present in generated code via the Transform tab.
Thank you very much.
Just one last note. Are we wrapping the list of transformOperations as a list or list of lists (one set of curly brackets or two)?
= Table.TransformColumns(Typed,{{"Date", Date.EndOfMonth, type date}})
Thanks again.
It is a list of lists, 2 curly brackets: you can specify transformations for multiple columns, and each specification has 2 or 3 items.
{{"Column1", operation1},{"Column2", operation2}, etcetra}
Thanks that did it. Cheers!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
85 | |
65 | |
51 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |