Forum Discussion
Remove last digits
- Anonymous3 years ago
please write the column name like this [#"All: Net Profit"]
Hi,
We can customize the digit option for fractional values, but I see that the value you have is not fractional. Therefore, the most practical way to get rid of 15 value has 0's is to create an add custom column step where you will divide.
You can insert a new step and create addcolumn like these example down below.
= Table.AddColumn(#"Changed Type", "Custom", each [Obj_Id]/1000000000000000)
Best regards,
Ezgi Naz Aslankara
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
= Table.AddColumn(#"Changed Type", "Custom", each [Obj_Id]/1000000000000000)
- elfunambolo833 years agoRegular Visitor
I need to do it for several columns. When I create the second one the first one disappear form the table.
How can I proceed?
Thanks
Giovanni
- Anonymous3 years agoNot applicable
I have created a sample script so you can review the steps I did. You can paste it into the Power Query advanced editor and review the steps I made.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRABUo6GEIGFkZYRJVidbDqNiJsoFJsLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [num1 = _t, num2 = _t, num3 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"num1", type number}, {"num2", type number}, {"num3", type number}}),
Custom1 = Table.AddColumn(#"Changed Type", "Custom", each [num1]/1000000000000000),
Custom2 = Table.AddColumn(Custom1, "Custom2", each [num2]/1000000000000000),
Custom3 = Table.AddColumn(Custom2, "Custom3", each [num3]/1000000000000000),
#"Removed Columns" = Table.RemoveColumns(Custom3,{"num1", "num2", "num3"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Custom", "num1"}, {"Custom2", "num2"}, {"Custom3", "num3"}})
in
#"Renamed Columns"- elfunambolo833 years agoRegular Visitor
Instead of num1,num2 etc.. I need to replace with my columns name?