This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi All,
I have a dataset with 50 columns and in column headers each column contains underscore and I want to remove all the underscore with space is there a way to do that
| Current Scenario | To Be | ||||||
| Account_Name | Year_mo | Sales_type | Registration_no | Account Name | Year mo | Sales type | Registration no |
This is the current scenario and I want the output to be like To Be columns name
Proud to be a Super User! |
|
Solved! Go to Solution.
Hi @bhanu_gautam ,
Please try select these columns and unpivot them --> replace "_" with " " and pivot columns.
Advanced editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRU0lEyMgISxvHGQNIEiE2B2EwpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column_1 = _t, Column_2 = _t, Column_3 = _t, #"Column 4" = _t, Column_5_1 = _t, Column_5_2 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column_1", Int64.Type}, {"Column_2", Int64.Type}, {"Column_3", type text}, {"Column 4", Int64.Type}, {"Column_5_1", Int64.Type}, {"Column_5_2", Int64.Type}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value"),
#"Replaced Value" = Table.ReplaceValue(#"Unpivoted Columns","_"," ",Replacer.ReplaceText,{"Attribute"}),
#"Pivoted Column" = Table.Pivot(#"Replaced Value", List.Distinct(#"Replaced Value"[Attribute]), "Attribute", "Value")
in
#"Pivoted Column"
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi,
= Table.TransformColumnNames(Your_Source, each Text.Replace(_,"_"," "))
Stéphane
Hi,
= Table.TransformColumnNames(Your_Source, each Text.Replace(_,"_"," "))
Stéphane
Hi @bhanu_gautam ,
Please try select these columns and unpivot them --> replace "_" with " " and pivot columns.
Advanced editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRU0lEyMgISxvHGQNIEiE2B2EwpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column_1 = _t, Column_2 = _t, Column_3 = _t, #"Column 4" = _t, Column_5_1 = _t, Column_5_2 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column_1", Int64.Type}, {"Column_2", Int64.Type}, {"Column_3", type text}, {"Column 4", Int64.Type}, {"Column_5_1", Int64.Type}, {"Column_5_2", Int64.Type}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value"),
#"Replaced Value" = Table.ReplaceValue(#"Unpivoted Columns","_"," ",Replacer.ReplaceText,{"Attribute"}),
#"Pivoted Column" = Table.Pivot(#"Replaced Value", List.Distinct(#"Replaced Value"[Attribute]), "Attribute", "Value")
in
#"Pivoted Column"
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.