Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone, could I please get help from anyone on how to rename all column names from the tables in "Custom" column and append them with the value from column "Code"
Solved! Go to Solution.
Use this code. Replace #"Grouped Rows" with your previous step name
= Table.FromRecords(Table.TransformRows(#"Grouped Rows", (r)=> [Code = r[Code], Custom = Table.TransformColumnNames(r[Custom], (x)=>x&Text.From(r[Code]))]))
Use this code. Replace #"Grouped Rows" with your previous step name
= Table.FromRecords(Table.TransformRows(#"Grouped Rows", (r)=> [Code = r[Code], Custom = Table.TransformColumnNames(r[Custom], (x)=>x&Text.From(r[Code]))]))
Thank you Vijay, it worked great.
Is there a way to rename columns that name which contains specific text, let's say rename columns that contains "abc" in the header only
Hi @Anonymous, check this. Remove ", Comparer.OrdinalIgnoreCase" from the code if you want case sensitive check.
let
Source = #table(type table[Code=Int64.Type, Custom=table], {
{6100, #table({"Column10", "Test abc 1", "Column20"}, {{1,2,3}})},
{6200, #table({"Column10", "Test abc", "A_Abc_B"}, {{4,5,6}})}
}),
Ad_Renamed = Table.AddColumn(Source, "Renamed", each Table.RenameColumns([Custom],
[ a = List.Select(Table.ColumnNames([Custom]), (x)=> Text.Contains(x, "abc", Comparer.OrdinalIgnoreCase)),
b = List.Zip({ a, List.Transform(a, (x)=> x & Text.From([Code])) })
][b]),
type table)
in
Ad_Renamed
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
9 | |
7 | |
5 | |
5 | |
5 |
User | Count |
---|---|
10 | |
8 | |
6 | |
6 | |
6 |