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.
Hi there!
Is there a way to accomplish the following:
I'll always have one row in this form. I want the 3rd column to be renamed as the value of previous column and then deleting the second column automatically so that output table should look like below:
I have number of files for which I need to apply this. Can anyone help me with this ?
Solved! Go to Solution.
Hi @A123-Chauhan ,
You can copy below code and paste it in Advanced Editor.
...
... ,
#"Renamed Columns" =
let _Name = List.Max(#"Merged Queries"[Table.Name]) in
Table.RenameColumns(#"Merged Queries",{{"Table.Table", _Name}}),
#"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"Table.Name"})
in
#"Removed Columns"
Pay attention to #"Merged Queries" in my code, this the step above "Renamed Columns" step, so you need to change it in your code. The logic of this code is to get max value in "Table.Name" column. Due to you only have one row so the max value is the name we need. Then use it to rename "Table.Table" column. Finally remove "Table.Name" column.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @A123-Chauhan ,
You can copy below code and paste it in Advanced Editor.
...
... ,
#"Renamed Columns" =
let _Name = List.Max(#"Merged Queries"[Table.Name]) in
Table.RenameColumns(#"Merged Queries",{{"Table.Table", _Name}}),
#"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"Table.Name"})
in
#"Removed Columns"
Pay attention to #"Merged Queries" in my code, this the step above "Renamed Columns" step, so you need to change it in your code. The logic of this code is to get max value in "Table.Name" column. Due to you only have one row so the max value is the name we need. Then use it to rename "Table.Table" column. Finally remove "Table.Name" column.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
14 | |
2 | |
2 | |
1 | |
1 |