<?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: distinct count with condition in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1203655#M19306</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;Can you share a sample .pbix file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;HN&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jul 2020 12:20:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-06T12:20:15Z</dc:date>
    <item>
      <title>distinct count with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1200569#M19167</link>
      <description>&lt;P&gt;Hello&amp;nbsp; How can I count distinct order_no which are only coming from specific traffic sources&amp;nbsp; (google, mail, bing)? So the distinctcount happens based on a pre-filtered data set (traffic sources). Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 14:12:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1200569#M19167</guid>
      <dc:creator>clarissa</dc:creator>
      <dc:date>2020-07-03T14:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: distinct count with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1200606#M19169</link>
      <description>&lt;P&gt;It sounds like a job for CALCULATE&lt;/P&gt;
&lt;P&gt;CALCULATE(DISTINCTCOUNT('Orders'[order_num]),'Orders'[source] IN { "google", "mail", "bing" })&lt;/P&gt;
&lt;P&gt;depending on the structure of your report and what the external filter context is you may have to add an ALL('Orders')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Join the conversation on &lt;A href="https://www.wetalkbi.com/" target="_self"&gt;We Talk BI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;More about me on &lt;A href="https://slowbi.com/" target="_self"&gt;Slow BI&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 14:33:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1200606#M19169</guid>
      <dc:creator>kentyler</dc:creator>
      <dc:date>2020-07-03T14:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: distinct count with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1202803#M19279</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="114168" data-lia-user-login="kentyler" class="lia-mention lia-mention-user"&gt;kentyler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data model is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- unique order number is in 1 table.&lt;/P&gt;&lt;P&gt;- Google Analytics order number table ("&lt;SPAN&gt;google_analytics_order_no")&amp;nbsp;&lt;/SPAN&gt;is combined with this unique order number (1 to *)&lt;/P&gt;&lt;P&gt;- ERP data ("sales") is combined with unique order number (1 to *). My formula looks like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# Order PMKT = CALCULATE(DISTINCTCOUNT(sales[order_no]), FILTER(google_analytics_order_no, google_analytics_order_no[source_medium] = "google / cpc" || google_analytics_order_no[source_medium] = "bing / cpc" || google_analytics_order_no[source_medium] = "criteo / display" || google_analytics_order_no[source_medium] = "awin / affiliate" || google_analytics_order_no[source_medium] = "facebook / social_paid"))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;when I count the numbers of Google Analytics I have more orders, which doesnt make sense:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# Order PMKT GA = CALCULATE(DISTINCTCOUNT(google_analytics_order_no[order_no]), FILTER(google_analytics_order_no, google_analytics_order_no[source_medium] = "google / cpc" || google_analytics_order_no[source_medium] = "bing / cpc" || google_analytics_order_no[source_medium] = "criteo / display" || google_analytics_order_no[source_medium] = "awin / affiliate" || google_analytics_order_no[source_medium] = "facebook / social_paid"))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does this formula with the filter not work in my datamodel?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks for your help, very much appreciated.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Clarissa&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 Jul 2020 06:41:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1202803#M19279</guid>
      <dc:creator>clarissa</dc:creator>
      <dc:date>2020-07-06T06:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: distinct count with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1203229#M19291</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;Try trouble shooting your DAX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Order PMKT = CALCULATE(DISTINCTCOUNT(sales[order_no]), FILTER(google_analytics_order_no, google_analytics_order_no[source_medium] = "google / cpc" )&lt;BR /&gt;&lt;BR /&gt;See if the formula is returning the correct value for "google/cpc".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, remove all trailing spaces by Trimming this column in Query Editor.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Harsh Nathani&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 09:09:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1203229#M19291</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-06T09:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: distinct count with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1203566#M19302</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. Why do you think it is linked to the trailing spaces? I get numbers but the Google Analytics number is higher than the Sales Table Number, which doesn't make sense... Is the DAX Formula right or does it react differently if the distinctcount is applied on another table than the filter table?`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 11:43:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1203566#M19302</guid>
      <dc:creator>clarissa</dc:creator>
      <dc:date>2020-07-06T11:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: distinct count with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1203655#M19306</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;Can you share a sample .pbix file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;HN&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 12:20:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1203655#M19306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-06T12:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: distinct count with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1203732#M19307</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Unfortunately not, but here the data modell&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;Does that help? B2C_unique_order_number is joined with the 2 other tables with the order-no (1 to *)&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 12:53:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/distinct-count-with-condition/m-p/1203732#M19307</guid>
      <dc:creator>clarissa</dc:creator>
      <dc:date>2020-07-06T12:53:19Z</dc:date>
    </item>
  </channel>
</rss>

