Forum Discussion
Programmatically change the case of headers (from a csv file)
- 9 years ago
Or just change the column headers:
let Source = #table(2,{{1,2}}), HeadersUpperCase = Table.TransformColumnNames(Source,Text.Upper) in HeadersUpperCase
Hi,
maybe there is another way, but I would do it in the 3 simple steps:
1. Transpose columns/rows
2. Format items in the headers column to Upper Case
3. Transpose back columns/rows
1. Transpose column to rows2. Format items in 'header' column to UPPer Case3. Transpose back rows to columns
Or just change the column headers:
let
Source = #table(2,{{1,2}}),
HeadersUpperCase = Table.TransformColumnNames(Source,Text.Upper)
in
HeadersUpperCase- MarkJF9 years agoFrequent Visitor
Thanks, now I can see the function Table.TransformColumnNames it all makes sense!
(I think the transpose method might work as well, but my table has thousands of rows which might be an issue.)
regards
Mark
- Anonymous7 years agoNot applicable
How would you apply to this to all the data vs the headers? I want it to make all the text in a table uppercase, but the number of columns change / are not consistent.
When I try to apply the same concept to the Table.TransformColumns it gives me an "Expression.Error: We cannot convert a value of type Function to type Text."