<?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: Date and time in an IoT project in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3016103#M102429</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="127937" data-lia-user-login="ppvinsights" class="lia-mention lia-mention-user"&gt;ppvinsights&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;perhaps no need to have an extremely huge size DateTime table, we only need a DateTime table that contains the exiating datetimes in our two fact tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;DateTime =
DISTINCT (
    UNION ( ALLNOBLANKROW ( Fact.1[DateTime] ), ALLNOBLANKROW ( Fact.2[DateTime] ) )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jan 2023 08:25:59 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-01-12T08:25:59Z</dc:date>
    <item>
      <title>Date and time in an IoT project</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3011547#M102120</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In an IoT project we have some machines which send several times a day messages. So we have a dimension table&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;DimMachine&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;and lets say a fact table&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;FactMessage&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The fact table has a timestamp. And several kpis like a charging rate.&lt;/P&gt;&lt;P&gt;An &lt;STRONG&gt;&lt;EM&gt;active&lt;/EM&gt; &lt;/STRONG&gt;machine is a machine which sends at least one message in a give time period. So I define&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;no of active machines =
COUNTROWS (
    FILTER (
        DimMachine,
        NOT ISBLANK ( COUNTROWS ( RELATEDTABLE ( FactMessage ) ) )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;Because we want to see active machines "in a given period" we define a calendar-dimension DimDate. So we need to extract the date of the timestamp in the FactMessage.&lt;/P&gt;&lt;P&gt;Usually I would introduce a time dimension as well, extract the time as well and delete the timestamp in my fact data. But:&lt;/P&gt;&lt;P&gt;We want to have a line chart in which we can show some of the kpis of the messages. We want to see, if the charging rate was over a given limit - we say "more than three time over the limit" then we have a problem. So we cannot show an average, min/max. We need to see the raw value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If using DimDate and DimTime for the x-axis in a line chart, we introduce (for the customer) a strange drillthrough. It looks much nicer if I would use the timestamp of the FactMessage for the x-Axis, because so I have a continouus axis which is much nicer than the default drill-down axis (if using DimDate and DimTime).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But using the Timestamp I would use data from a fact table in an axis - which I would love to avoid (e.g.: if having another FactTable with say "errors" I could not bring this information in the same visual - because the timestamp of FactMEssage is not a shared dimension).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But introducing a combined Date/Time Dimension with 86.400 rows per day cannot be the solution for that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Other pitfall if working with DimDate AND DimTime are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;when we have to show the raw data in a table, you alway have two columns: date and time - and you have to sort both. Using the timestamp you only need to sort one column.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;If you have any date/time calculation (e.g. "show me the last message before myself"), you first have to add date and time again, before you can calculate anything&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Do you understand what I mean? How do you handle those situations?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Holger&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 15:16:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3011547#M102120</guid>
      <dc:creator>ppvinsights</dc:creator>
      <dc:date>2023-01-10T15:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date and time in an IoT project</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3011835#M102140</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="127937" data-lia-user-login="ppvinsights" class="lia-mention lia-mention-user"&gt;ppvinsights&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to understand. Need some screenshots of your report or at least the shape of your report aling with the expected results. Cannot picture what are you trying to achieve.&amp;nbsp;&lt;BR /&gt;one possibility is to have extra two columns, one for date only connected to dim date and one for time only &amp;nbsp;connected to dim time. for any calculation that requires the full datetime value you can allways use the original column from the fact table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 17:03:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3011835#M102140</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-01-10T17:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Date and time in an IoT project</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3015865#M102413</link>
      <description>&lt;P&gt;&amp;nbsp;Hi,&lt;/P&gt;&lt;P&gt;yeah - it is hard to explain. The essence (after two days it is easier to tell something about the real problem &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; ) is, that I need the timestamp in my axis.&lt;/P&gt;&lt;P&gt;==&amp;gt; I want to show testdata from a machine - like how much electricity was used when starting something. My customer want to see ALL results in a line chart. If I would use DimDate, the line chart would show a maximum or mean of my testdata. Even if I use DimDate AND DimTime as an axis, my customer would have to drill down to see every result without any aggregation. So I use the timestamp of the fact table because I do not have a "DimDateTime" Dimension. But: What if I need another kpi in the same line chart from another fact table? Because the timestamp is not a shared dimension...?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I fully understand why you have to separate date and time in a filtertable/shared dimension. But what, if I need to have timestamps in my axis?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any cool idea I do not see?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Holger&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 07:04:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3015865#M102413</guid>
      <dc:creator>ppvinsights</dc:creator>
      <dc:date>2023-01-12T07:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Date and time in an IoT project</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3015920#M102419</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="127937" data-lia-user-login="ppvinsights" class="lia-mention lia-mention-user"&gt;ppvinsights&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You may try using TREATAS to change the lineage of the Fact.[DateTime] . Simething like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CALCULATE (&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; [Measure],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; TREATAS ( VALUES (&amp;nbsp;Fact.[DateTime] ),&amp;nbsp;Fact.2[DateTime] )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 07:29:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3015920#M102419</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-01-12T07:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date and time in an IoT project</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3015957#M102423</link>
      <description>&lt;P&gt;Yeah, I understand - but works only, if the timestamp in Fact 1 is exactly the same as in Fact 2. I think I have a phantom problem and there is no obvious solution for a shared dimension with DateTimes...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 07:38:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3015957#M102423</guid>
      <dc:creator>ppvinsights</dc:creator>
      <dc:date>2023-01-12T07:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Date and time in an IoT project</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3016103#M102429</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="127937" data-lia-user-login="ppvinsights" class="lia-mention lia-mention-user"&gt;ppvinsights&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;perhaps no need to have an extremely huge size DateTime table, we only need a DateTime table that contains the exiating datetimes in our two fact tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;DateTime =
DISTINCT (
    UNION ( ALLNOBLANKROW ( Fact.1[DateTime] ), ALLNOBLANKROW ( Fact.2[DateTime] ) )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 08:25:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3016103#M102429</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-01-12T08:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date and time in an IoT project</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3016420#M102447</link>
      <description>&lt;P&gt;Yes, your are totally right! Because really often we just talk about &amp;lt;10 DataPoints per day. So I could introduce a DimDate, a DimTime and between the tose and the fact table I just add this TimeStamp-Union Table with two calulated "Date" and "Time" cols.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your time!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 10:03:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-time-in-an-IoT-project/m-p/3016420#M102447</guid>
      <dc:creator>ppvinsights</dc:creator>
      <dc:date>2023-01-12T10:03:00Z</dc:date>
    </item>
  </channel>
</rss>

