<?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: Summarize by 2 columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-by-2-columns/m-p/2141949#M49243</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312920" data-lia-user-login="SammyNed" class="lia-mention lia-mention-user"&gt;SammyNed&lt;/a&gt; , You can use date and month year from date table, if you are using that in visual&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try measure like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;countx(filter(summarize(Table, Table[Customer],"_1", calculate(distinctcount(Table[Date]))),[_1] &amp;gt;1),[Customer])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;countx(filter(summarize(Table, Table[Customer], Table[Month Year],"_1", calculate(distinctcount(Table[Date]))),[_1] &amp;gt;1),[Customer])&lt;/P&gt;</description>
    <pubDate>Tue, 19 Oct 2021 03:13:03 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-10-19T03:13:03Z</dc:date>
    <item>
      <title>Summarize by 2 columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-by-2-columns/m-p/2141411#M49229</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need some assistance please.&lt;/P&gt;&lt;P&gt;This is long winded, but I have the following table, simplified below. Basically customer ID's, date of order and order category. I want to know how many cummulative 'Loyal" customers per month and what category the LOYALS are buying from per month. a 'Loyal" customer is someone who has ordered more than once.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I want to know how many loyal customers i accumulate per month as well as which category they are ordering from.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in March we should only have 1 loyal customer (customer A with 3 orders).&lt;/P&gt;&lt;P&gt;In April we should have 2 loyal customers (customer A with a total of 4 orders and customer C with a total of 3 orders). This ties in with the first graph and DAX measure below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then secondly of those that are loyal, i want to know how many orders they place per category per month, as per the second graph.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in Mar, A ( who is loyal now) spent 1 order in 3 categorys.&lt;/P&gt;&lt;P&gt;In April, A (loyal for life) ordered in 1 category and C (who is now Loyal) ordered from 2 different categorys.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following thus far to make the first graph, but can't seem to incorporate the category type to get the second graph as it then starts calculating the loyal customers PER category which isn't correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Loyal Customers Count = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_month&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(Date&lt;/SPAN&gt;&lt;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&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_loyalcustomerstable&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_customercounttable&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;[@customercount]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;=2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_loyalcustomerstable&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please help.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SammyNed&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 19:34:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-by-2-columns/m-p/2141411#M49229</guid>
      <dc:creator>SammyNed</dc:creator>
      <dc:date>2021-10-18T19:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize by 2 columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-by-2-columns/m-p/2141949#M49243</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312920" data-lia-user-login="SammyNed" class="lia-mention lia-mention-user"&gt;SammyNed&lt;/a&gt; , You can use date and month year from date table, if you are using that in visual&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try measure like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;countx(filter(summarize(Table, Table[Customer],"_1", calculate(distinctcount(Table[Date]))),[_1] &amp;gt;1),[Customer])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;countx(filter(summarize(Table, Table[Customer], Table[Month Year],"_1", calculate(distinctcount(Table[Date]))),[_1] &amp;gt;1),[Customer])&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 03:13:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-by-2-columns/m-p/2141949#M49243</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-10-19T03:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize by 2 columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-by-2-columns/m-p/2145606#M49372</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply, but i don't see how your solution can give me the second graph which needs to include the categorys purchased? Am i missing something?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 12:20:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-by-2-columns/m-p/2145606#M49372</guid>
      <dc:creator>SammyNed</dc:creator>
      <dc:date>2021-10-20T12:20:36Z</dc:date>
    </item>
  </channel>
</rss>

