<?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 help check for duplicates in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-check-for-duplicates/m-p/2132028#M48925</link>
    <description>&lt;P&gt;Hi, thanks in advance for any help, we have the following requirements:&lt;/P&gt;&lt;P&gt;I've tried a few different methods to pull this together but all hit a memory issue, any suggestions on the best approach/script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To identify duplicate clients based on email address:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1. For clients creating a new case in September, using email address how many have a different case same month&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2. For clients creating a new case in September, using email address how many have a different case previous month(s)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fields:&lt;/P&gt;&lt;P&gt;CaseSurrogateKey, Email, InteractionDate, FirstSessionYN&lt;/P&gt;&lt;P&gt;Check if the email address exists previously but with a different case&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob flagged as a duplicate client (based on email) with a new case same month&lt;/P&gt;&lt;P&gt;Ted flagged as a duplicate client (based on email) with a new case different month(s) - as has a case in Jul and Aug already&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Oct 2021 10:11:07 GMT</pubDate>
    <dc:creator>CrazyHorse66</dc:creator>
    <dc:date>2021-10-13T10:11:07Z</dc:date>
    <item>
      <title>DAX help check for duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-check-for-duplicates/m-p/2132028#M48925</link>
      <description>&lt;P&gt;Hi, thanks in advance for any help, we have the following requirements:&lt;/P&gt;&lt;P&gt;I've tried a few different methods to pull this together but all hit a memory issue, any suggestions on the best approach/script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To identify duplicate clients based on email address:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1. For clients creating a new case in September, using email address how many have a different case same month&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2. For clients creating a new case in September, using email address how many have a different case previous month(s)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fields:&lt;/P&gt;&lt;P&gt;CaseSurrogateKey, Email, InteractionDate, FirstSessionYN&lt;/P&gt;&lt;P&gt;Check if the email address exists previously but with a different case&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob flagged as a duplicate client (based on email) with a new case same month&lt;/P&gt;&lt;P&gt;Ted flagged as a duplicate client (based on email) with a new case different month(s) - as has a case in Jul and Aug already&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 10:11:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-check-for-duplicates/m-p/2132028#M48925</guid>
      <dc:creator>CrazyHorse66</dc:creator>
      <dc:date>2021-10-13T10:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help check for duplicates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-check-for-duplicates/m-p/2132955#M48941</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327331" data-lia-user-login="CrazyHorse66" class="lia-mention lia-mention-user"&gt;CrazyHorse66&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;As a general recommendation, please, provide a sample data as text, use the table tool in the editing bar. This will increase your chances to get an answer.&lt;/P&gt;
&lt;P&gt;As for your case, you can try these measures:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;firstSession = 
VAR currentEmail = SELECTEDVALUE ( T[Email] )
VAR currentCase = SELECTEDVALUE ( T[Case] )
VAR currentDate = SELECTEDVALUE ( T[Date] )
VAR firstSession =
    MINX (
        FILTER ( ALL ( T ), T[Case] = currentCase &amp;amp;&amp;amp; T[Email] = currentEmail ),
        T[Date]
    )
RETURN
    IF ( currentDate = firstSession, "Y", "N" )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;flag = 
VAR currentEmail = SELECTEDVALUE ( T[Email] )
VAR _t =
    ADDCOLUMNS (
        CALCULATETABLE ( ALLSELECTED ( T ), T[Email] = currentEmail ),
        "@month", CALCULATE ( MONTH ( MAX ( T[Date] ) ) )
    )
VAR _t2 = SUMMARIZE ( _t, [@month] )
RETURN
    SWITCH (
        TRUE (),
        [firstSession] = "Y" &amp;amp;&amp;amp; COUNTROWS ( _t2 ) = 1, "same month",
        [firstSession] = "Y" &amp;amp;&amp;amp; COUNTROWS ( _t2 ) &amp;gt; 1, "prev month",
        BLANK ()
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="2" color="#333399"&gt;&lt;EM&gt;If this post helps, then please consider &lt;U&gt;Accept it as the solution&lt;/U&gt; &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;to help the other members find it more quickly.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 16:22:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-check-for-duplicates/m-p/2132955#M48941</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2021-10-13T16:22:07Z</dc:date>
    </item>
  </channel>
</rss>

