<?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: How to remove milliseconds or round to nearest second in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/4108848#M163050</link>
    <description>&lt;P&gt;Hi! In my case I want to use the rounded up values, can you let me know how did you achieve that?&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2024 09:16:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-08-20T09:16:51Z</dc:date>
    <item>
      <title>How to remove milliseconds or round to nearest second</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/722587#M1429</link>
      <description>&lt;P&gt;So I have a column of date times in a SQL Server databas as per below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2019-06-20 06:02:55.667&lt;BR /&gt;2019-06-20 06:02:55.433&lt;BR /&gt;2019-06-20 06:20:00.083&lt;BR /&gt;2019-06-20 06:20:00.053&lt;BR /&gt;2019-06-20 06:20:00.130&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I create a model in SSAS I get the following rows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;6/20/2019 6:02:55 AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/20/2019 6:02:55 AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/20/2019 6:20:00 AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/20/2019 6:20:00 AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/20/2019 6:20:00 AM&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At first glance the miliseconds no longer appear. However, when I try to do aggregations based on the date I actually get incorrect results because the miliseconds make these rows appear all different.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I actually want is to find a way to remove the milliseconds from the datetime. I have tried using the DAX FORMAT function however it actually rounds up the miliseconds and I get the followign results:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;20/06/19 06:02:56&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20/06/19 06:02:55&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20/06/19 06:20:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20/06/19 06:20:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20/06/19 06:20:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see the first two rows now have 56 and 55 seconds. This is because the milliseconds get rounded up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I create a new column which actually has 55 seconds for both first and second row? Is there a way to tell the DAX function to round down the milliseconds? Or just remove them completely?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 13:20:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/722587#M1429</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-24T13:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove milliseconds or round to nearest second</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/722924#M1443</link>
      <description>&lt;P&gt;Is this Power BI ? If so, in Power Query you can Split column on the last occurrence of '.' (This must be before the data type is changed to DateTime (or similar).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not, I think you can use the same Power Query functionality in newer versions of Analysis Services.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 20:46:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/722924#M1443</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2019-06-24T20:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove milliseconds or round to nearest second</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/723213#M1447</link>
      <description>&lt;P&gt;Yes, it is indeed Power BI. However, it is a live connection from SSAS. As such, all the data modelling needs to happen in SSAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But you might be onto something there with splitting the column. I will try that out. However, the issue is that the milliseconds do not actually appear in SSAS (but they exist somewhere in the back as they are taken in consideration when doing calculations, distinct etc.).&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 06:23:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/723213#M1447</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-25T06:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove milliseconds or round to nearest second</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/725989#M1542</link>
      <description>&lt;PRE&gt;let
    Source = "2019-06-20 06:02:55.667",
    SourceToDateTimeFormat = DateTime.FromText(Source)
in
    SourceToDateTimeFormat&lt;/PRE&gt;&lt;P&gt;Just tried this out of curiosity. The code above is giving the output "20-06-2019 06:02:55".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 09:00:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/725989#M1542</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-27T09:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove milliseconds or round to nearest second</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/4108848#M163050</link>
      <description>&lt;P&gt;Hi! In my case I want to use the rounded up values, can you let me know how did you achieve that?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 09:16:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-milliseconds-or-round-to-nearest-second/m-p/4108848#M163050</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-20T09:16:51Z</dc:date>
    </item>
  </channel>
</rss>

