<?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 Occurrences of future dates based on single date column for site locations in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Occurrences-of-future-dates-based-on-single-date-column/m-p/1405018#M25909</link>
    <description>&lt;P&gt;Looking for some help on counting dates in a column which will allow filtering per location.&lt;/P&gt;&lt;P&gt;If we imagine a fictional warehouse table where id is a single order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Id&lt;/TD&gt;&lt;TD&gt;Received&lt;/TD&gt;&lt;TD&gt;Processed&lt;/TD&gt;&lt;TD&gt;Checked&lt;/TD&gt;&lt;TD&gt;Dispatched&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2020-01-01&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2020-01-01&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2020-01-01&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2020-01-01&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2020-01-01&lt;/TD&gt;&lt;TD&gt;2020-01-01&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-03&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have linked the received&amp;nbsp;field to a column of single dates in my calendar table.&lt;/P&gt;&lt;P&gt;What I am looking for is to list out each date from the calendar and count the number of dates for each category that match so e.g. for the date 2020-01-01&lt;BR /&gt;We recieved 2 orders&lt;/P&gt;&lt;P&gt;We processed 2 orders&lt;/P&gt;&lt;P&gt;We checked 1 order&lt;/P&gt;&lt;P&gt;We dispatched 1 order&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the table of orders above it would result in&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Received&lt;/TD&gt;&lt;TD&gt;Processed&lt;/TD&gt;&lt;TD&gt;Checked&lt;/TD&gt;&lt;TD&gt;Dispatched&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-01-01&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-01-03&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-01-10&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought I had it with this code where I added a count of dates to the calendar table in a calculated column. One column for each count of received, processed, checked, dispatched.&lt;/P&gt;&lt;P&gt;'checked one below'&lt;/P&gt;&lt;P&gt;checked_orders = CALCULATE(COUNTROWS(orders), FILTER(orders, orders[checked] = 'Calendar'[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Terribly inneficient I know but I am trying anything. Anyway the method doesn't seem to be the correct way as it won't allow filtering on locations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you imagine the orders table is filled with orders from 10 locations identified by a location_id 1-10 . If the user selects a specific location e.g. location 2 then the results table should only list the count of recieved, processed,checked,dispatched for location 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For help, it is safe to assume that every day of the year will have at least 1 order per day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if the description seems strange, the actual problem relates to a pharmacy company with many branches so tried to relate it to an easier to explain problem.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 14:23:30 GMT</pubDate>
    <dc:creator>C-G-Davidson</dc:creator>
    <dc:date>2020-09-30T14:23:30Z</dc:date>
    <item>
      <title>Count Occurrences of future dates based on single date column for site locations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Occurrences-of-future-dates-based-on-single-date-column/m-p/1405018#M25909</link>
      <description>&lt;P&gt;Looking for some help on counting dates in a column which will allow filtering per location.&lt;/P&gt;&lt;P&gt;If we imagine a fictional warehouse table where id is a single order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Id&lt;/TD&gt;&lt;TD&gt;Received&lt;/TD&gt;&lt;TD&gt;Processed&lt;/TD&gt;&lt;TD&gt;Checked&lt;/TD&gt;&lt;TD&gt;Dispatched&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2020-01-01&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2020-01-01&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2020-01-01&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2020-01-01&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2020-01-01&lt;/TD&gt;&lt;TD&gt;2020-01-01&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-03&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have linked the received&amp;nbsp;field to a column of single dates in my calendar table.&lt;/P&gt;&lt;P&gt;What I am looking for is to list out each date from the calendar and count the number of dates for each category that match so e.g. for the date 2020-01-01&lt;BR /&gt;We recieved 2 orders&lt;/P&gt;&lt;P&gt;We processed 2 orders&lt;/P&gt;&lt;P&gt;We checked 1 order&lt;/P&gt;&lt;P&gt;We dispatched 1 order&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the table of orders above it would result in&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Received&lt;/TD&gt;&lt;TD&gt;Processed&lt;/TD&gt;&lt;TD&gt;Checked&lt;/TD&gt;&lt;TD&gt;Dispatched&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-01-01&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-01-02&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-01-03&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-01-10&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought I had it with this code where I added a count of dates to the calendar table in a calculated column. One column for each count of received, processed, checked, dispatched.&lt;/P&gt;&lt;P&gt;'checked one below'&lt;/P&gt;&lt;P&gt;checked_orders = CALCULATE(COUNTROWS(orders), FILTER(orders, orders[checked] = 'Calendar'[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Terribly inneficient I know but I am trying anything. Anyway the method doesn't seem to be the correct way as it won't allow filtering on locations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you imagine the orders table is filled with orders from 10 locations identified by a location_id 1-10 . If the user selects a specific location e.g. location 2 then the results table should only list the count of recieved, processed,checked,dispatched for location 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For help, it is safe to assume that every day of the year will have at least 1 order per day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if the description seems strange, the actual problem relates to a pharmacy company with many branches so tried to relate it to an easier to explain problem.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 14:23:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Occurrences-of-future-dates-based-on-single-date-column/m-p/1405018#M25909</guid>
      <dc:creator>C-G-Davidson</dc:creator>
      <dc:date>2020-09-30T14:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Count Occurrences of future dates based on single date column for site locations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Occurrences-of-future-dates-based-on-single-date-column/m-p/1405052#M25912</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="138831" data-lia-user-login="C-G-Davidson" class="lia-mention lia-mention-user"&gt;C-G-Davidson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You need to create four measures and no need to link the date table with the calendar table if you arent not using it for any other purpose.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Received Count = 
COUNTROWS(
    FILTER(
        Table10,
        Table10[Received] = MAX('Table'[Date])
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Processed Count = 
COUNTROWS(
    FILTER(
        Table10,
        Table10[Processed] = MAX('Table'[Date])
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Checked Count = 
COUNTROWS(
    FILTER(
        Table10,
        Table10[Checked] = MAX('Table'[Date])
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Dispatched Count = 
COUNTROWS(
    FILTER(
        Table10,
        Table10[Dispatched] = MAX('Table'[Date])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help the other members find it&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank" rel="noopener"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank" rel="noopener"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 14:40:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Occurrences-of-future-dates-based-on-single-date-column/m-p/1405052#M25912</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-09-30T14:40:14Z</dc:date>
    </item>
  </channel>
</rss>

