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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
ovetteabejuela
Impactful Individual
Impactful Individual

PowerQuery | Rename a Cell (Cell(1,1)

Hi Community,

 

Another simple but tricky one right here(for me).

 

RenameCell11.PNG

 

I want to promote those 2 top rows into headers... but look at column 1. How do I remove the date part or the whole ( : m/d/yy ) part before promoting it to a header.

1 ACCEPTED SOLUTION

Hi @ovetteabejuela,

 

Taking into account that you only need the first row to be change follow this steps:

- Add Index column (if you use the automatic index will start at zero)

- Add custom column with following formula

 if [Index] = 0 then
   Text.Start([Column1],4)
else
  Text.End([Column1],Text.Length([Column1])-6)

The Text.Start with 4 letter will give you the date the Text.End is the full text lenght minus 6 character ("Date" = 4 + ": " = 2) 

- Then remove the Index and Column one

- Promote headers

 

See image below with the step by step and M code so you can test it.

 

Column Title.png

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckksSbVSMDDUNzDTNzIwNFfSUQpKLcssTk1RitXBKm1qYIBXKhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1),
    #"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each if [Index] = 0 then
Text.Start([Column1],4)
else
Text.End([Column1],Text.Length([Column1])-6)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Column1", "Index"}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Columns", [PromoteAllScalars=true])
in
    #"Promoted Headers"

Regards,

MFelix

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

8 REPLIES 8
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @ovetteabejuela,

 

I don't think there is an easy way to edit an individual value using Query Editor currently. Here is a similar thread for your reference.

 

By the way, may I know why you want to edit the cell value before promoting it into a header? Why not promote it into headers first, then just rename the promoted header name? Smiley LOL

 

Regards

@v-ljerr-msft,

 

"By the way, may I know why you want to edit the cell value before promoting it into a header? Why not promote it into headers first, then just rename the promoted header name? Smiley LOL"

 

 

This was an option for me, but how do I get rid of the : m/d/yy part? it's not always going to be 6/1/17 it could be something else everytime.

Hi @ovetteabejuela,

 

Taking into account that you only need the first row to be change follow this steps:

- Add Index column (if you use the automatic index will start at zero)

- Add custom column with following formula

 if [Index] = 0 then
   Text.Start([Column1],4)
else
  Text.End([Column1],Text.Length([Column1])-6)

The Text.Start with 4 letter will give you the date the Text.End is the full text lenght minus 6 character ("Date" = 4 + ": " = 2) 

- Then remove the Index and Column one

- Promote headers

 

See image below with the step by step and M code so you can test it.

 

Column Title.png

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckksSbVSMDDUNzDTNzIwNFfSUQpKLcssTk1RitXBKm1qYIBXKhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1),
    #"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each if [Index] = 0 then
Text.Start([Column1],4)
else
Text.End([Column1],Text.Length([Column1])-6)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Column1", "Index"}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Columns", [PromoteAllScalars=true])
in
    #"Promoted Headers"

Regards,

MFelix

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thanks @MFelix for putting that together, worked very well.

MFelix
Super User
Super User

Hi @ovetteabejuela,

 

Use the Split columns option in the Tansform tab and then select By number of Characther in this case 4 then you will get two columns one with Date in all of the values and another with :m/d/yy them simply delete the last column.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thanks @MFelix,

 

Yes, that is actually easy but if you look closely, I don't think that would work... 

 

RenameCell11_endresult.PNG

Hi @ovetteabejuela,

 

Bu I don't understand what is the final result you want? You wrote "How do I remove the date part or the whole ( : m/d/yy )" what is the part you want to save in your column? the date part or the "Date:" part?

 

Sorry for making this questions but I getting confused in your messages

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Here's how I envisioned it but don't know how to implement:

 

RenameCell11_step-by-step.PNG

Helpful resources

Announcements
December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.