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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MarkJF
Frequent Visitor

Programmatically change the case of headers (from a csv file)

Hi

 

I created a detailed report Report with data from csv files, and the Promoted Headers function provided me with headers all in lower case.

I now need to change the Source of the files, and the new files all have the Headers names in UPPer case; is there a way to select the first row of the imported table and convert it to Upper case before the Promoted Headers command?

 

Maybe using Table.SelectRows or similar commands?

 

Thanks

 

Mark

1 ACCEPTED SOLUTION

Or just change the column headers:

 

let
    Source = #table(2,{{1,2}}),
    HeadersUpperCase = Table.TransformColumnNames(Source,Text.Upper)
in
    HeadersUpperCase
Specializing in Power Query Formula Language (M)

View solution in original post

4 REPLIES 4
pawel1
Kudo Kingpin
Kudo Kingpin

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 rows1. Transpose column to rows2. Format items in 'header' column to UPPer Case2. Format items in 'header' column to UPPer Case3. Transpose back rows to columns3. 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
Specializing in Power Query Formula Language (M)

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

Anonymous
Not 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."

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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