<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Removing zeros from after decimal point in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842744#M6449</link>
    <description>&lt;P&gt;Right, that was the code that I provided, it essentially created a new column with the correct values. You could use that logic to add the new column in Power Query and then that new column will show up in your data model with the corrected values.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2019 19:54:16 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2019-11-11T19:54:16Z</dc:date>
    <item>
      <title>Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842591#M6436</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset that includes diagnosis codes, and a related dataset that acts as a key to categorize/explain each diagnosis. Problem is that some diagnoses were entered with zeros at the end (which are basically irrelevant) so they don't match the related dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;An easy solution would be to convert to number (since that removes ending zeros) but the codes can include letters so they cannot be converted.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;If I have F41.1, F41.10, F41.100, F90.0, F90, 310, 310.0, 310.00,&amp;nbsp; 309.4, 309.40, 309.41&lt;/P&gt;&lt;P&gt;I want F41.1, F90, 310, 309.4, 309.41&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if better in DAX or Power Query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 16:04:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842591#M6436</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2019-11-11T16:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842606#M6437</link>
      <description>&lt;P&gt;You could try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcjMx1DNUitWBsgyQmFC2pYEenAWmjQ3htB4SC8o0sNQzQbCQBIG2xAIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Code = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Code", type text}}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "Code", Splitter.SplitTextByEachDelimiter({"."}, QuoteStyle.Csv, true), {"Code.1", "Code.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Code.1", type text}, {"Code.2", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type1","0","",Replacer.ReplaceText,{"Code.2"}),
    #"Added Custom" = Table.AddColumn(#"Replaced Value", "Custom", each if [Code.2] = null or [Code.2] = "" then [Code.1] else [Code.1] &amp;amp; "." &amp;amp; [Code.2]),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Code.1", "Code.2"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Custom", "Code"}})
in
    #"Renamed Columns"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Nov 2019 16:20:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842606#M6437</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2019-11-11T16:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842623#M6439</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That worked for the sample list I wrote.&lt;/P&gt;&lt;P&gt;(I added it as a custom column)&lt;/P&gt;&lt;P&gt;How do I apply that to my actual dataset? Preferably as a column, not table; transforming each row to the correct diagnosis code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to upload a snapshot.&lt;/P&gt;&lt;P&gt;Table is called Diagnoses, Column is Diagnosis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Nov 2019 16:41:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842623#M6439</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2019-11-11T16:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842629#M6440</link>
      <description>&lt;P&gt;Do you mean back to original source data?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 16:52:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842629#M6440</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2019-11-11T16:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842645#M6441</link>
      <description>&lt;P&gt;Yes.&lt;/P&gt;&lt;P&gt;Which parts of your code need to be changed to connect it to my source data?&lt;/P&gt;&lt;P&gt;(sorry if this isn't so coherent, I'm pretty new at this)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 17:20:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842645#M6441</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2019-11-11T17:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842652#M6442</link>
      <description>&lt;P&gt;In general you can't use Power BI to updat your source data. The solution for your source data would be dependent on the source format, is it Excel, SQL, Oracle, something else?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 17:32:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842652#M6442</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2019-11-11T17:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842674#M6443</link>
      <description>&lt;P&gt;Source data is SQL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 18:20:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842674#M6443</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2019-11-11T18:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842734#M6447</link>
      <description>&lt;P&gt;OK, you'll have to get someone that knows SQL better than I to write an equivalent update query if you want to fix your suorce data. Probably need to find a SQL forum for that.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 19:41:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842734#M6447</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2019-11-11T19:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842737#M6448</link>
      <description>&lt;P&gt;I don't think I will be able to fix the source data.&lt;/P&gt;&lt;P&gt;Is there any way to make the change on the power bi end?&amp;nbsp;&lt;/P&gt;&lt;P&gt;It could be a new column, where if there is a zero past the decimal point the zero should be erased.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 19:45:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842737#M6448</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2019-11-11T19:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842744#M6449</link>
      <description>&lt;P&gt;Right, that was the code that I provided, it essentially created a new column with the correct values. You could use that logic to add the new column in Power Query and then that new column will show up in your data model with the corrected values.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 19:54:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842744#M6449</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2019-11-11T19:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842774#M6451</link>
      <description>&lt;P&gt;Thanks for your patience!&lt;/P&gt;&lt;P&gt;I get that the logic works, just not sure what part of your code to replace to use it.&lt;/P&gt;&lt;P&gt;Would you mind walking me thorugh the code, or even highlighting the parts that need to be replaced with my source? I'm getting errors regarding Type.&lt;/P&gt;&lt;P&gt;The column I'm using is a text column named Diagnosis, from table Diagnoses.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 20:20:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/842774#M6451</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2019-11-11T20:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/843161#M6455</link>
      <description>&lt;OL&gt;
&lt;LI&gt;In Query Editor select your query that loads your table&lt;/LI&gt;
&lt;LI&gt;Select your column, Diagnosis. choose Transform | Split Column | By Delimiter in ribbon&lt;/LI&gt;
&lt;LI&gt;Make sure delimiter is a period (.)&lt;/LI&gt;
&lt;LI&gt;OK&lt;/LI&gt;
&lt;LI&gt;2 columns are created, should be Diagnosis.1 and Diagnosis.2&lt;/LI&gt;
&lt;LI&gt;Right click Diagnosis.2 and choose Replace Values&lt;/LI&gt;
&lt;LI&gt;Value to find 0&lt;/LI&gt;
&lt;LI&gt;Replace with leave blank&lt;/LI&gt;
&lt;LI&gt;Select Advanced Options, make sure Match entire cell contents is NOT selected&lt;/LI&gt;
&lt;LI&gt;OK&lt;/LI&gt;
&lt;LI&gt;Zeros are gone&lt;/LI&gt;
&lt;LI&gt;Choose Add Column in ribbon and then Custom Column&lt;/LI&gt;
&lt;LI&gt;Use this formula:&amp;nbsp;if [Code.2] = null or [Code.2] = "" then [Code.1] else [Code.1] &amp;amp; "." &amp;amp; [Code.2]&lt;/LI&gt;
&lt;LI&gt;Remove Diagnosis.1 and Diagnosis.2&lt;/LI&gt;
&lt;LI&gt;Rename your new column Diagnosis&lt;/LI&gt;
&lt;LI&gt;Give Greg a Kudo &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 12 Nov 2019 04:44:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/843161#M6455</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2019-11-12T04:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/843819#M6469</link>
      <description>&lt;P&gt;Thank you so much Greg!!&lt;/P&gt;&lt;P&gt;Worked perfectly!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 15:27:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/843819#M6469</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2019-11-12T15:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/2834926#M90421</link>
      <description>&lt;P&gt;You can customize the format of your data by using custom numeric format characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I used to remove trailing 0's from my decimal number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/format-function-dax" target="_blank"&gt;https://learn.microsoft.com/en-us/dax/format-function-dax&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 19:56:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/2834926#M90421</guid>
      <dc:creator>mike_brooks</dc:creator>
      <dc:date>2022-10-11T19:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/3398558#M128261</link>
      <description>&lt;P&gt;Hello Mr. Deckler, and thanks for your informative answer. I tried it and ended up with a new column containing both whole numbers without trailing 0's&amp;nbsp; and decimals. So far so good. But,&amp;nbsp; this is a text column. In order to use it in a chart it has to be a "numbers" column. So, it has to be formatted to a Decimal number or a Whole number type column. And we're back to square one.. Or am I wrong? very likely.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 07:34:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/3398558#M128261</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-25T07:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Removing zeros from after decimal point</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/3734111#M145538</link>
      <description>&lt;P&gt;Maybe it did not solve &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="185398" data-lia-user-login="EF" class="lia-mention lia-mention-user"&gt;EF&lt;/a&gt;&amp;nbsp;'s problem but it sure did solve mine!!!&lt;BR /&gt;&lt;BR /&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="114284" data-lia-user-login="mike_brooks" class="lia-mention lia-mention-user"&gt;mike_brooks&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 16:12:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Removing-zeros-from-after-decimal-point/m-p/3734111#M145538</guid>
      <dc:creator>Daniel_PowerBI</dc:creator>
      <dc:date>2024-02-29T16:12:57Z</dc:date>
    </item>
  </channel>
</rss>

