<?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 UNIQUE ITEMS PER ORDER/PER CLIENT + INTERVAL BETWEEN ORDERS in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-UNIQUE-ITEMS-PER-ORDER-PER-CLIENT-INTERVAL-BETWEEN-ORDERS/m-p/2952321#M97945</link>
    <description>&lt;P&gt;Hello team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After a quick research and a few attempts, I'm still struggling to find the solution I need.&lt;BR /&gt;Maybe it's a simple question for more experienced users, but I'm finding it hard to find the solutions to my problem.&lt;BR /&gt;&lt;BR /&gt;My report has a &lt;U&gt;single dataset (or table)&lt;/U&gt; that combines &lt;STRONG&gt;sales transactions from 3 clients&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Each row of my dataset is &lt;STRONG&gt;one item of an order&lt;/STRONG&gt;, and the table structure is the same for those three clients.&lt;/P&gt;&lt;P&gt;The fields I have on my dataset are:&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;reward_program_code&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (or client ID)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;account_id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (which is the customer ID from my client side)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;member_uid&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (which is the customer ID from my side)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;account_reference&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (which is the customer ID that the system creates when combining the account_id + member_uid)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;order_number&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (unique identifier of each order)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;transaction_date&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (date of purchase)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;SKU&lt;/STRONG&gt; &lt;/EM&gt;&lt;/FONT&gt;(unique product identifier)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;product_name&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (product name from my client system)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;product_category&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (name of product category from m y client system)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;quantity&lt;/STRONG&gt; &lt;/EM&gt;&lt;/FONT&gt;(units sold for that product SKU, on that order)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;total_cost&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (cost of sales from my client)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;total_sell&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (total revenue per item on that order)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating a set of measures that will be used on a dashboard, such as:&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;total revenue&lt;/STRONG&gt; (sum of &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;EM&gt;total_sell&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;order frequency&lt;/STRONG&gt; (distinct count of &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;order_id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;revenue per order&lt;/STRONG&gt; (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;total_sell&lt;/STRONG&gt;&lt;/FONT&gt; divided by the distinct count of &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;order_id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;total quantity per order&lt;/STRONG&gt; (sum of &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;quantity&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; per &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;order_id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am struggling with two measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) count the &lt;U&gt;number of unique products sold per order&lt;/U&gt; (distinct count of &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;SKU &lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;per &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;order_id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;).&lt;/P&gt;&lt;P&gt;2) measure the &lt;U&gt;number of days between the last 2 orders&lt;/U&gt; for each &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;member_uid&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with that? Would be great if I could add to those measures a filter by client (&lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;reward_program_code&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;) as well.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 19:54:36 GMT</pubDate>
    <dc:creator>cperazza</dc:creator>
    <dc:date>2022-12-06T19:54:36Z</dc:date>
    <item>
      <title>COUNT UNIQUE ITEMS PER ORDER/PER CLIENT + INTERVAL BETWEEN ORDERS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-UNIQUE-ITEMS-PER-ORDER-PER-CLIENT-INTERVAL-BETWEEN-ORDERS/m-p/2952321#M97945</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After a quick research and a few attempts, I'm still struggling to find the solution I need.&lt;BR /&gt;Maybe it's a simple question for more experienced users, but I'm finding it hard to find the solutions to my problem.&lt;BR /&gt;&lt;BR /&gt;My report has a &lt;U&gt;single dataset (or table)&lt;/U&gt; that combines &lt;STRONG&gt;sales transactions from 3 clients&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Each row of my dataset is &lt;STRONG&gt;one item of an order&lt;/STRONG&gt;, and the table structure is the same for those three clients.&lt;/P&gt;&lt;P&gt;The fields I have on my dataset are:&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;reward_program_code&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (or client ID)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;account_id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (which is the customer ID from my client side)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;member_uid&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (which is the customer ID from my side)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;account_reference&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (which is the customer ID that the system creates when combining the account_id + member_uid)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;order_number&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (unique identifier of each order)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;transaction_date&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (date of purchase)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;SKU&lt;/STRONG&gt; &lt;/EM&gt;&lt;/FONT&gt;(unique product identifier)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;product_name&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (product name from my client system)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;product_category&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (name of product category from m y client system)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;quantity&lt;/STRONG&gt; &lt;/EM&gt;&lt;/FONT&gt;(units sold for that product SKU, on that order)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;total_cost&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (cost of sales from my client)&lt;/P&gt;&lt;P&gt;- &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;total_sell&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; (total revenue per item on that order)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating a set of measures that will be used on a dashboard, such as:&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;total revenue&lt;/STRONG&gt; (sum of &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;EM&gt;total_sell&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;order frequency&lt;/STRONG&gt; (distinct count of &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;order_id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;revenue per order&lt;/STRONG&gt; (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;total_sell&lt;/STRONG&gt;&lt;/FONT&gt; divided by the distinct count of &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;order_id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;total quantity per order&lt;/STRONG&gt; (sum of &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;quantity&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; per &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;order_id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am struggling with two measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) count the &lt;U&gt;number of unique products sold per order&lt;/U&gt; (distinct count of &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;SKU &lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;per &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;order_id&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;).&lt;/P&gt;&lt;P&gt;2) measure the &lt;U&gt;number of days between the last 2 orders&lt;/U&gt; for each &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;member_uid&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with that? Would be great if I could add to those measures a filter by client (&lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;reward_program_code&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;) as well.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 19:54:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-UNIQUE-ITEMS-PER-ORDER-PER-CLIENT-INTERVAL-BETWEEN-ORDERS/m-p/2952321#M97945</guid>
      <dc:creator>cperazza</dc:creator>
      <dc:date>2022-12-06T19:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: COUNT UNIQUE ITEMS PER ORDER/PER CLIENT + INTERVAL BETWEEN ORDERS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-UNIQUE-ITEMS-PER-ORDER-PER-CLIENT-INTERVAL-BETWEEN-ORDERS/m-p/2956248#M98209</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="404502" data-lia-user-login="cperazza" class="lia-mention lia-mention-user"&gt;cperazza&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please share some sample data so that we could test the formula.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 09:34:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-UNIQUE-ITEMS-PER-ORDER-PER-CLIENT-INTERVAL-BETWEEN-ORDERS/m-p/2956248#M98209</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-08T09:34:03Z</dc:date>
    </item>
  </channel>
</rss>

