<?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 Dax Calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2171235#M50421</link>
    <description>&lt;P&gt;To find out how many times a Job ID appears in my Data set, I used the formula&lt;/P&gt;&lt;P&gt;&lt;EM&gt;COUNTROWS(FILTER('Engrs Timesheet', EARLIER('Engrs Timesheet'[Job ID],1) = ('Engrs Timesheet'[Job ID]))) in the column&lt;STRONG&gt; VISITCOUNT2&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I further want to streamline my analysis to count only job numbers that appear multiple times on different days and (not on the same date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;So here is a sample of my Data&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to write a function that counts the number of times a Job number appears into the &lt;STRONG&gt;VisitCount2&lt;/STRONG&gt; column, but I only want it to count it as two if the job numbers are not on the same On-site date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is &lt;STRONG&gt;D0000178&lt;/STRONG&gt; should be counted as 3 rather than 4 because two of its elements have the same &lt;STRONG&gt;On-site date&lt;/STRONG&gt; &lt;STRONG&gt;(11/10/2021)&lt;/STRONG&gt; same as &lt;STRONG&gt;M00002062&lt;/STRONG&gt; which should be counted as 2 instead of 3 because two of its elements have same &lt;STRONG&gt;On-site date (26/10/2021)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;BR /&gt;Thank you all&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Nov 2021 18:10:46 GMT</pubDate>
    <dc:creator>Femi10</dc:creator>
    <dc:date>2021-11-03T18:10:46Z</dc:date>
    <item>
      <title>Dax Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2171235#M50421</link>
      <description>&lt;P&gt;To find out how many times a Job ID appears in my Data set, I used the formula&lt;/P&gt;&lt;P&gt;&lt;EM&gt;COUNTROWS(FILTER('Engrs Timesheet', EARLIER('Engrs Timesheet'[Job ID],1) = ('Engrs Timesheet'[Job ID]))) in the column&lt;STRONG&gt; VISITCOUNT2&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I further want to streamline my analysis to count only job numbers that appear multiple times on different days and (not on the same date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;So here is a sample of my Data&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to write a function that counts the number of times a Job number appears into the &lt;STRONG&gt;VisitCount2&lt;/STRONG&gt; column, but I only want it to count it as two if the job numbers are not on the same On-site date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is &lt;STRONG&gt;D0000178&lt;/STRONG&gt; should be counted as 3 rather than 4 because two of its elements have the same &lt;STRONG&gt;On-site date&lt;/STRONG&gt; &lt;STRONG&gt;(11/10/2021)&lt;/STRONG&gt; same as &lt;STRONG&gt;M00002062&lt;/STRONG&gt; which should be counted as 2 instead of 3 because two of its elements have same &lt;STRONG&gt;On-site date (26/10/2021)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;BR /&gt;Thank you all&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 18:10:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2171235#M50421</guid>
      <dc:creator>Femi10</dc:creator>
      <dc:date>2021-11-03T18:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2171412#M50425</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="331408" data-lia-user-login="Femi10" class="lia-mention lia-mention-user"&gt;Femi10&lt;/a&gt;&amp;nbsp; you can try this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
CALCULATE (
    COUNTX (
        SUMMARIZE ( 'Table', 'Table'[ID], 'Table'[On Site] ),
        'Table'[On Site]
    ),
    ALLEXCEPT ( 'Table', 'Table'[ID] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pbix is attached&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;</description>
      <pubDate>Wed, 03 Nov 2021 20:37:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2171412#M50425</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-03T20:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2171540#M50429</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24978" data-lia-user-login="smpa01" class="lia-mention lia-mention-user"&gt;smpa01&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It worked perfectly well&lt;BR /&gt;&lt;BR /&gt;Thank you so much!!!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 23:28:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2171540#M50429</guid>
      <dc:creator>Femi10</dc:creator>
      <dc:date>2021-11-03T23:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2172428#M50459</link>
      <description>&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/24978" target="_blank"&gt;@smpa01&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you please share a brief explanation on how you came about this solution.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 10:47:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2172428#M50459</guid>
      <dc:creator>Femi10</dc:creator>
      <dc:date>2021-11-04T10:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2172797#M50478</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="331408" data-lia-user-login="Femi10" class="lia-mention lia-mention-user"&gt;Femi10&lt;/a&gt;&amp;nbsp; sure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you dissect the code, it has three parts&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
CALCULATE (
    COUNTX (
        SUMMARIZE ( 'Table', 'Table'[ID], 'Table'[On Site] ),
        'Table'[On Site]
    ),
    ALLEXCEPT ( 'Table', 'Table'[ID] )
)&lt;/LI-CODE&gt;
&lt;P&gt;the inner most part is SUMMARIZE, the immediate outer part is COUNTX and outer most part is Calculate with partition(ALLEXCEPT).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SUMMARIZE generates a distinct table with all &lt;STRONG&gt;unique&lt;/STRONG&gt; combinations of ID and Site which looks like this&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;COUNTX has an iterator&amp;nbsp; and if I pass on the following it generates this which is the total count of all the rows from that summarized table&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;CALCULATE being the modifier, the partition by which the count needs to be performed can be mentioned and it gives the desired result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 14:13:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculation/m-p/2172797#M50478</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-04T14:13:18Z</dc:date>
    </item>
  </channel>
</rss>

