Forum Discussion
phchu1226
4 years agoHelper IV
Issue on rename column dynamically
Hi all, Refer to this post: https://community.powerbi.com/t5/Desktop/Auto-renaming-columns-based-on-value-in-another-table/m-p/79018 I am able to rename the column based on current date, i....
phchu1226
4 years agoHelper IV
Hi Anonymous,
I knew that I can rename back to the original column name to solve this issue..
However, what I want to do is to rename the column name based on the date,
e.g. today is 8/2, the column should be look like below:
Is it possible to do so?? Thanks.
phchu1226
4 years agoHelper IV
Anonymous,
excuse me, is there any update?
- Anonymous4 years agoNot applicable
Hi phchu1226 ,
I have found a simuliar post, please refer to it to see if it helps you.
ow to rename column name as current Date dynamically?
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtFTSUTJVitUhgmOElWMB5BgaEMuzQOPEAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Year = _t, #"Value " = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", Int64.Type}, {"Value ", Int64.Type}}), #"Renamed Columns" = Table.RenameColumns(#"Changed Type", { { "Year", let currentDateTime = DateTimeZone.LocalNow(), currentYear = Number.ToText( Date.Year( currentDateTime ) ), currentMonth = Date.MonthName( currentDateTime ) in currentYear & "-" & currentMonth } } ) in #"Renamed Columns"Best Regards Community Support Team _ PollyBest Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.