Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I' ve two tables in my editor. One contains data and the other contains translations for the column header.
#"Table1"
|active|activationName|descriptiveText|
| 1 | Sample | Is a sample. |
| 2 | Exampl2 | This another |
#"Table2"
| dbColumnName | label|
| descriptiveText| Description|
|activationName| Name of Activation|
|active | Activated|
Now I want to translate the column header of the first column with the names of the second table using power query advanced editor. I found an example the forum to remove "_" in the header table name :
#"Result" = Table.RenameColumns(#"Table1", Table.ToRows(Table.AddColumn(Table.FromList(Table.ColumnNames(#"Table1")), "New Column Name", each Text.Replace ( [Column1] , {"Column1.dbColumnName"} , {"Column1.label"} ))))
Therefore, I tried to edit the request in the way that column dbColumnName shall be found and replaced with Column1.label.
But that doesn't work out. How can I do this?
Solved! Go to Solution.
If you mean that you want to translate the column header of the first table with the labels of the second table:
#"Renamed Columns" = Table.RenameColumns(Table1,Table.ToRows(Table2), MissingField.Ignore)
You can omit the , MissingField.Ignore, but then you will get errors if any of the dbColumnNames in Table2 doesn't exist in Table1.
If you mean that you want to translate the column header of the first table with the labels of the second table:
#"Renamed Columns" = Table.RenameColumns(Table1,Table.ToRows(Table2), MissingField.Ignore)
You can omit the , MissingField.Ignore, but then you will get errors if any of the dbColumnNames in Table2 doesn't exist in Table1.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |