Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
In Power BI,
We can dynamically change the title name using measure in Format > Title > fx
But is there a way , I can change name of the column Header also dynamically using the measure??
Solved! Go to Solution.
Hi @dia612,
It means you can create a list with the column names you wanted, then you can invoke them in your query table with 'renamecolumns' function to dynamic rename current column names:
Columnname stored a list of column names strings
let
Source = {"id","name","desc"}
in
Source
Query table invokes above list to rename fields:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRU0lEyMgISxsZKsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"Column2", Int64.Type}, {"Column3", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",List.Zip({Table.ColumnNames(#"Changed Type"),ColumnNames}))
in
#"Renamed Columns"
Regards,
Xiaoxin Sheng
HI @dia612,
You can try to create a list with column names and invoke it in query table steps to dynamic rename your columns on the query editor side.
>>But is there a way , I can change name of the column Header also dynamically using the measure??
Nope, measure formulas impossible to interact with data model fields dynamically. (its source are generated from data model tables, you can't use child level to effect its parent)
Regards,
Xiaoxin Sheng
Hello @Anonymous ,
Thankyou for taking time for replying.
I did not understand your suggestion clearly
"You can try to create a list with column names and invoke it in query table steps to dynamic rename your columns on the query editor side"
Could you please explain it with example
Hi @dia612,
It means you can create a list with the column names you wanted, then you can invoke them in your query table with 'renamecolumns' function to dynamic rename current column names:
Columnname stored a list of column names strings
let
Source = {"id","name","desc"}
in
Source
Query table invokes above list to rename fields:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRU0lEyMgISxsZKsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"Column2", Int64.Type}, {"Column3", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",List.Zip({Table.ColumnNames(#"Changed Type"),ColumnNames}))
in
#"Renamed Columns"
Regards,
Xiaoxin Sheng
@dia612 , refer
https://www.youtube.com/watch?v=yEemVBiaTuk
https://www.goodly.co.in/dynamic-column-names-power-query/
https://www.thebiccountant.com/2018/07/04/efficiently-rename-column-names-with-a-function-in-power-b...
https://community.powerbi.com/t5/Desktop/Dynamic-column-name-from-its-value/td-p/189442
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |