<?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: Calculate distinct customer-Id per day in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157706#M17730</link>
    <description>&lt;P&gt;Perhaps something more explicit:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sumx(values(table[date], distinctcount..&lt;/P&gt;</description>
    <pubDate>Sun, 14 Jun 2020 12:49:58 GMT</pubDate>
    <dc:creator>stevedep</dc:creator>
    <dc:date>2020-06-14T12:49:58Z</dc:date>
    <item>
      <title>Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1156959#M17689</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with following schema:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Customer ID&lt;/P&gt;&lt;P&gt;13.1.2020&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;&lt;P&gt;13.1.2020&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;&lt;P&gt;13.1.2020&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;/P&gt;&lt;P&gt;20.1.2020&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C&lt;/P&gt;&lt;P&gt;1.2.2020&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;/P&gt;&lt;P&gt;14.2.2020&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;BR /&gt;&lt;BR /&gt;I need to count the distinct Customer-ID per day which serves as the number of orders, so the result would be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A= 2&lt;/P&gt;&lt;P&gt;B= 2&lt;/P&gt;&lt;P&gt;C=1&lt;BR /&gt;&lt;BR /&gt;This column "number of orders" should sum up over a filtered time. I tried it with this formula, but the sum of the counted rows per month doesn't show the right total:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Number of Orders = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var NumberOfOrders = CALCULATE(DISTINCTCOUNT('Mart DimCustomer'[Customer_ID]); ALLSELECTED('Mart FactInvoice'[date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Return CALCULATE(NumberOfOrders)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Any recommendations how to solve this? Thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jun 2020 07:49:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1156959#M17689</guid>
      <dc:creator>clarissa</dc:creator>
      <dc:date>2020-06-13T07:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157009#M17691</link>
      <description>&lt;P&gt;You'll want to have different calculations depending if you are in a "row" or in the total. Use HASONEVALUE() to differentiate.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jun 2020 10:26:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157009#M17691</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-13T10:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157037#M17693</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236631" data-lia-user-login="clarissa" class="lia-mention lia-mention-user"&gt;clarissa&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a measure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Distinct Count of Customer Day = COUNTROWS(SUMMARIZE('Table','Table'[Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 13 Jun 2020 11:22:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157037#M17693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-13T11:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157060#M17695</link>
      <description>&lt;P&gt;Hi Harsh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your feedback. Unfortunately the number shows way too less orders when I calculate it this way... I only get 12 orders per month April although it should be much more.... Could it be that this formula only counts distinct customer_ID per filtered time frame? So if a customer orders 4x in April and I filter April, that I only get 1x the customer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would need every customer ID per day as 1 count and if that customer ID appears 2x or 3x it should count it only 1x per day..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Was it clear what I try to achieve?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help and best regards, Clarissa&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jun 2020 13:01:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157060#M17695</guid>
      <dc:creator>clarissa</dc:creator>
      <dc:date>2020-06-13T13:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157463#M17710</link>
      <description>&lt;P&gt;When you tried the expression by&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;did you visual have Customer ID in it?&amp;nbsp; In any case, if you modify that expression as follows, it should work whether it is or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Distinct Count of Customer Day = COUNTROWS(SUMMARIZE('Table','Table'[Date], 'Table'[customer_ID]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 01:17:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157463#M17710</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-06-14T01:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157561#M17719</link>
      <description>&lt;P&gt;thank you Pat.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you explain me, what this Summary function with the 2 groups (date, ID) actually does?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and why does this formula not work?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(DISTINCTCOUNT('Tabe'[Customer_ID]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Would it just count the distinct customer IDs in the time period I would filter in the table? so if the time period changes it would also change the count to the new time period and only count distinct IDs?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 14 Jun 2020 07:54:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157561#M17719</guid>
      <dc:creator>clarissa</dc:creator>
      <dc:date>2020-06-14T07:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157573#M17721</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try SUMX(disctinctcount ...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need an interator to sum subtotals.&lt;/P&gt;&lt;P&gt;Kind regards, Steve.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 08:12:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157573#M17721</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-14T08:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157676#M17728</link>
      <description>&lt;P&gt;Hi Steve,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you. I tried it with your proposal:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Count Orders = SUMX('Mart FactInvoice'; (DISTINCTCOUNT('Mart FactInvoice'[CustomerID])))&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;but it counts several duplicate customer IDs for the same day:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Clarissa&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 11:38:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157676#M17728</guid>
      <dc:creator>clarissa</dc:creator>
      <dc:date>2020-06-14T11:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157706#M17730</link>
      <description>&lt;P&gt;Perhaps something more explicit:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sumx(values(table[date], distinctcount..&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 12:49:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157706#M17730</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-14T12:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157733#M17731</link>
      <description>&lt;P&gt;Hi Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so you would write it like this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Count Orders = SUMX(VALUES('Mart FactInvoice'[Date]);DISTINCTCOUNT('Mart FactInvoice'[customer-id]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 14 Jun 2020 13:35:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157733#M17731</guid>
      <dc:creator>clarissa</dc:creator>
      <dc:date>2020-06-14T13:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157737#M17732</link>
      <description>&lt;P&gt;Yes, if this doesn't work we need to know the data model.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 13:36:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157737#M17732</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-14T13:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct customer-Id per day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157759#M17734</link>
      <description>&lt;P&gt;Hi Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately it doesnt work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data model:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- 1 table factinvoice with revenues and invoice dates (*)&lt;/P&gt;&lt;P&gt;- 1 table with customer (1)&lt;/P&gt;&lt;P&gt;- join through customer_id: 1 to *&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Does that help? Thanks for your support!&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 14:02:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-distinct-customer-Id-per-day/m-p/1157759#M17734</guid>
      <dc:creator>clarissa</dc:creator>
      <dc:date>2020-06-14T14:02:03Z</dc:date>
    </item>
  </channel>
</rss>

