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 have column with text type which contains numbers also.
from this column i want to format numbers to comma separted .My new column should be like this
plse help
Solved! Go to Solution.
Based on your sample data this M code in Power Query does exactly what you want.
You can download a sample PBIX file here
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjLVMTAwUIrVATJ1TA3gHEMgC8ExAAMw2y+/RME5vyy1KDUFzIdoVVXIzcxTMETSo6sUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [all = _t]),
#"Added Custom" = Table.AddColumn(Source, "Custom", each try Number.ToText(Number.From([all]),"N") otherwise [all]),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each try if Text.Contains([Custom],".00") then Text.Start([Custom],Text.Length([Custom])-3) else [Custom] otherwise ""),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"Custom"})
in
#"Removed Columns"
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Based on your sample data this M code in Power Query does exactly what you want.
You can download a sample PBIX file here
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjLVMTAwUIrVATJ1TA3gHEMgC8ExAAMw2y+/RME5vyy1KDUFzIdoVVXIzcxTMETSo6sUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [all = _t]),
#"Added Custom" = Table.AddColumn(Source, "Custom", each try Number.ToText(Number.From([all]),"N") otherwise [all]),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each try if Text.Contains([Custom],".00") then Text.Start([Custom],Text.Length([Custom])-3) else [Custom] otherwise ""),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"Custom"})
in
#"Removed Columns"
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
thanks
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 |
---|---|
111 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |