<?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 Count of instances by day and hour in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-instances-by-day-and-hour/m-p/1953198#M42621</link>
    <description>&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;&lt;P&gt;Hello PBI community,&lt;BR /&gt;&lt;BR /&gt;I'm looking to count number of loads by hour. The dataset spans over two days and the table visual is calculating the measure incorrectly. What am I doing wrong here? How can I show the visual over two days?&lt;BR /&gt;&lt;BR /&gt;I have some loads that are loaded on 22/06/2021 to be delivered on 23/06/2021. The matrix visual only displays 23/06/2021 data.&lt;BR /&gt;&lt;BR /&gt;When DAX is calculating the measure it is counting by hour only and not on the date. Example:&lt;BR /&gt;for 18:00 hours, on 22/06/2021&amp;nbsp;@ 18:00 hours I have 6 loads and on 23/06/2021&amp;nbsp;@ 18:00 hours I have 1. However in the visual it is showing as 23/6/2021&amp;nbsp;@ 18:00 hours as 7 (which is 6 from 22/06 + 1 from 23/06)&lt;BR /&gt;&lt;BR /&gt;I have selected cross filter direction as 'Both' for creating relationship between date and hour table with data table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Below is the link for power bi file and excel file which shows the difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/sh/l94j7rb9iavm783/AADqJs6dOZU06anbmdfftyiUa?dl=0" target="_blank" rel="noopener"&gt;https://www.dropbox.com/sh/l94j7rb9iavm783/AADqJs6dOZU06anbmdfftyiUa?dl=0&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jul 2021 00:24:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-13T00:24:55Z</dc:date>
    <item>
      <title>Count of instances by day and hour</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-instances-by-day-and-hour/m-p/1953198#M42621</link>
      <description>&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;&lt;P&gt;Hello PBI community,&lt;BR /&gt;&lt;BR /&gt;I'm looking to count number of loads by hour. The dataset spans over two days and the table visual is calculating the measure incorrectly. What am I doing wrong here? How can I show the visual over two days?&lt;BR /&gt;&lt;BR /&gt;I have some loads that are loaded on 22/06/2021 to be delivered on 23/06/2021. The matrix visual only displays 23/06/2021 data.&lt;BR /&gt;&lt;BR /&gt;When DAX is calculating the measure it is counting by hour only and not on the date. Example:&lt;BR /&gt;for 18:00 hours, on 22/06/2021&amp;nbsp;@ 18:00 hours I have 6 loads and on 23/06/2021&amp;nbsp;@ 18:00 hours I have 1. However in the visual it is showing as 23/6/2021&amp;nbsp;@ 18:00 hours as 7 (which is 6 from 22/06 + 1 from 23/06)&lt;BR /&gt;&lt;BR /&gt;I have selected cross filter direction as 'Both' for creating relationship between date and hour table with data table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Below is the link for power bi file and excel file which shows the difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/sh/l94j7rb9iavm783/AADqJs6dOZU06anbmdfftyiUa?dl=0" target="_blank" rel="noopener"&gt;https://www.dropbox.com/sh/l94j7rb9iavm783/AADqJs6dOZU06anbmdfftyiUa?dl=0&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 00:24:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-instances-by-day-and-hour/m-p/1953198#M42621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-13T00:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count of instances by day and hour</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-instances-by-day-and-hour/m-p/1953935#M42625</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;First, bi-directional relations are to be used in very rare cases. You don't need them here.&lt;/P&gt;&lt;P&gt;Second, here is the refernce to the correct usage of&amp;nbsp;USERELATIONSHIP&amp;nbsp;function:&amp;nbsp;&lt;A href="https://dax.guide/userelationship/" target="_blank"&gt;https://dax.guide/userelationship/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know the final result you want to achieve, but from what you've mentioned, you can try to change your measure in the next way:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count of loads by hour =
CALCULATE (
    COUNT ( f_DataTable[Route ID] ),
    USERELATIONSHIP ( f_DataTable[Load Date], d_DateTable[Date] ),
    USERELATIONSHIP ( f_DataTable[Load Time], d_HourTable[Time] )
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#333399"&gt;&lt;EM&gt;If this post helps, then please consider &lt;U&gt;Accept it as the solution&lt;/U&gt; &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;to help the other members find it more quickly.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 07:33:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-instances-by-day-and-hour/m-p/1953935#M42625</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2021-07-13T07:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count of instances by day and hour</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-instances-by-day-and-hour/m-p/1954446#M42632</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291363" data-lia-user-login="ERD" class="lia-mention lia-mention-user"&gt;ERD&lt;/a&gt;&amp;nbsp;That's amazing! Thanks for your help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 10:46:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-instances-by-day-and-hour/m-p/1954446#M42632</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-13T10:46:02Z</dc:date>
    </item>
  </channel>
</rss>

