Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
sekhar438
Frequent Visitor

How to remove decimals?

Hi Team,

 

how to remove decimals for fixed values,

Required output as below like

Remove Decimals.JPG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sekhar438 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) Click "Advanced Editor" to copy and paste the following code, check the steps in the right step bar.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtYzNfJVitWJVjLVszCHsoz0DAyAzFgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Sales = _t]),
    #"Split Column by Character Transition" = Table.SplitColumn(Source, "Sales", Splitter.SplitTextByCharacterTransition({"0".."9"}, (c) => not List.Contains({"0".."9"}, c)), {"Sales.1", "Sales.2", "Sales.3"}),
    #"Added Conditional Column" = Table.AddColumn(#"Split Column by Character Transition", "Custom", each if [Sales.2] = ".00" then null else [Sales.2]),
    #"Merged Columns" = Table.CombineColumns(#"Added Conditional Column",{"Sales.1", "Custom", "Sales.3"},Combiner.CombineTextByDelimiter("", QuoteStyle.None),"Merged"),
    #"Removed Columns" = Table.RemoveColumns(#"Merged Columns",{"Sales.2"})
in
    #"Removed Columns"

 

(3) Then the result is as follows.

vtangjiemsft_0-1683253767153.png

You can refer to the following documents that may be helpful to you:

3 Ways to Truncate Numbers (Remove Decimals) in Power Query (gorilla.bi)

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @sekhar438 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) Click "Advanced Editor" to copy and paste the following code, check the steps in the right step bar.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtYzNfJVitWJVjLVszCHsoz0DAyAzFgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Sales = _t]),
    #"Split Column by Character Transition" = Table.SplitColumn(Source, "Sales", Splitter.SplitTextByCharacterTransition({"0".."9"}, (c) => not List.Contains({"0".."9"}, c)), {"Sales.1", "Sales.2", "Sales.3"}),
    #"Added Conditional Column" = Table.AddColumn(#"Split Column by Character Transition", "Custom", each if [Sales.2] = ".00" then null else [Sales.2]),
    #"Merged Columns" = Table.CombineColumns(#"Added Conditional Column",{"Sales.1", "Custom", "Sales.3"},Combiner.CombineTextByDelimiter("", QuoteStyle.None),"Merged"),
    #"Removed Columns" = Table.RemoveColumns(#"Merged Columns",{"Sales.2"})
in
    #"Removed Columns"

 

(3) Then the result is as follows.

vtangjiemsft_0-1683253767153.png

You can refer to the following documents that may be helpful to you:

3 Ways to Truncate Numbers (Remove Decimals) in Power Query (gorilla.bi)

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Thanks for your reply Neeko Tang

If I used the above script, deleted all columns of data

Anonymous
Not applicable

Hi @sekhar438 ,

 

This is just an example. You can add other data columns to the source. Or you can refer to the steps in the step column on the right in your own table to split the [Sales] column, then add a custom column, and finally merge it.

vtangjiemsft_0-1683537579842.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors