<?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: Find repeat values based on criteria in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679284#M34439</link>
    <description>&lt;P&gt;Can you provide some sample data? This is doable.&lt;/P&gt;</description>
    <pubDate>Sun, 21 Feb 2021 18:19:11 GMT</pubDate>
    <dc:creator>stevedep</dc:creator>
    <dc:date>2021-02-21T18:19:11Z</dc:date>
    <item>
      <title>Find repeat values based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679251#M34437</link>
      <description>&lt;P&gt;I’m hoping you all might be able to help me. I’m fairly experienced in Power BI but can’t figure this issue out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a list of dates/times and phone numbers and departments (and some other data as well). What I am trying to do is figure out if a certain department is better at answer questions the first time, resulting in the fewest call backs.&lt;/P&gt;&lt;P&gt;For example, let’s say phone number&amp;nbsp;&lt;A href="tel:1234567890" target="_blank" rel="noopener"&gt;1234567890&lt;/A&gt;&amp;nbsp;called and was routed to Department Y. Then a week later they called again, and the call was routed to Department X. I want this to be counted as a repeat caller for Department Y (because they originally contacted Department Y first, so it’s department Y’s “fault” they are calling again).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Happy to clarify more if needed. I also don’t care if this is written with Dax or M.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also just made a breakthrough where I was able to have a running count of whether the call was 1st, 2nd, 3rd, etc. Time the phone number has called. So now I just need something that says: If the number is greater than 1, then find the first instance of the number and return which department answered the call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 20:56:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679251#M34437</guid>
      <dc:creator>jl02</dc:creator>
      <dc:date>2021-02-21T20:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Find repeat values based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679284#M34439</link>
      <description>&lt;P&gt;Can you provide some sample data? This is doable.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 18:19:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679284#M34439</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2021-02-21T18:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Find repeat values based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679297#M34442</link>
      <description>&lt;P&gt;Here is some made-up data similar to my own. Thank you, I appreciate your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Department PhoneNumber Agent Name Handled Call Start Date Time&lt;BR /&gt;Department Y 1234567890 Agent A 1 1/11/2021 0:00&lt;BR /&gt;Department X 7992770143 Agent B 1 1/11/2021 1:00&lt;BR /&gt;Department Y 2488783829 Agent C 1 1/11/2021 2:00&lt;BR /&gt;Department X 6835524237 Agent D 1 1/11/2021 3:00&lt;BR /&gt;Department X 2332764601 Agent A 1 1/11/2021 4:00&lt;BR /&gt;Department X 7313145153 Agent B 1 1/11/2021 5:00&lt;BR /&gt;Department X 4084243370 Agent C 1 1/11/2021 6:00&lt;BR /&gt;Department Y 8973413311 Agent D 1 1/11/2021 7:00&lt;BR /&gt;Department Y 6695770722 Agent A 1 1/11/2021 8:00&lt;BR /&gt;Department X 4633454011 Agent B 1 1/11/2021 9:00&lt;BR /&gt;Department X 4429767573 Agent C 1 1/12/2021 1:00&lt;BR /&gt;Department Y 7119122965 Agent D 1 1/12/2021 2:00&lt;BR /&gt;Department Y 5333900839 Agent A 1 1/12/2021 3:00&lt;BR /&gt;Department X 6646796325 Agent B 1 1/12/2021 4:00&lt;BR /&gt;Department Y 5928797526 Agent C 1 1/12/2021 5:00&lt;BR /&gt;Department Y 2632458048 Agent D 1 1/12/2021 6:00&lt;BR /&gt;Department X 3785692381 Agent A 1 1/12/2021 7:00&lt;BR /&gt;Department Y 3645446875 Agent B 1 1/12/2021 8:00&lt;BR /&gt;Department X 1234567890 Agent C 1 1/12/2021 9:00&lt;BR /&gt;Department Y 8684000132 Agent D 1 1/12/2021 10:00&lt;BR /&gt;Department X 3904431282 Agent A 1 1/13/2021 0:00&lt;BR /&gt;Department Y 3758663467 Agent B 1 1/13/2021 1:00&lt;BR /&gt;Department Y 8952477505 Agent C 1 1/13/2021 2:00&lt;BR /&gt;Department Y 2145389427 Agent D 1 1/13/2021 3:00&lt;BR /&gt;Department Y 5455993022 Agent A 1 1/13/2021 4:00&lt;BR /&gt;Department Y 8884283253 Agent B 1 1/13/2021 5:00&lt;BR /&gt;Department Y 5943076692 Agent C 1 1/13/2021 6:00&lt;BR /&gt;Department X 4602842729 Agent D 1 1/13/2021 7:00&lt;BR /&gt;Department Y 8027007073 Agent A 1 1/13/2021 8:00&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 19:48:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679297#M34442</guid>
      <dc:creator>jl02</dc:creator>
      <dc:date>2021-02-21T19:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Find repeat values based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679774#M34454</link>
      <description>&lt;P&gt;Based on your provided data source.&lt;img /&gt;&lt;BR /&gt;&lt;A href="https://crocsconnect-my.sharepoint.com/:u:/g/personal/jazhang_crocs_com/Earu3a5X29ZJj6tQ-Kll21sBAFMlFkaHdNFmSYc4sMVPZw?e=KFPxJC" target="_self"&gt;PBIX FILE&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 04:46:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679774#M34454</guid>
      <dc:creator>jameszhang0805</dc:creator>
      <dc:date>2021-02-22T04:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Find repeat values based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679879#M34455</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="286579" data-lia-user-login="jl02" class="lia-mention lia-mention-user"&gt;jl02&lt;/a&gt;&amp;nbsp;, Not sure if its already answered. But I think you want to check if somebody took the call first and then check to see if they called again later (within a certain time frame, set by parameter). This is what I have for you:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;First check if they called again later:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;NoOfCallsbyNumberLaterOn = 

VAR _selNo = SELECTEDVALUE('Table'[PhoneNo])
VAR _DT = SELECTEDVALUE('Table'[DT])
VAR _DTEnd = _DT + SELECTEDVALUE(NoOfDays[NoOfDays])

RETURN
COUNTROWS(FILTER(ALL('Table'),[PhoneNo] = _selNo  &amp;amp;&amp;amp; [DT].[Date] &amp;gt; _DT &amp;amp;&amp;amp; [DT].[Date] &amp;lt; _DTEnd))
&lt;/LI-CODE&gt;
&lt;P&gt;Check if they were the first one to take the call:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;OrderOfCallTakers = 

VAR _selNo = SELECTEDVALUE('Table'[PhoneNo])
VAR _DT = SELECTEDVALUE('Table'[DT])
VAR _DTEnd = _DT + SELECTEDVALUE(NoOfDays[NoOfDays])

RETURN
COUNTROWS(FILTER(ALL('Table'),[PhoneNo] = _selNo  &amp;amp;&amp;amp; [DT].[Date] &amp;lt;= _DT &amp;amp;&amp;amp; [DT].[Date] &amp;lt; _DTEnd))
&lt;/LI-CODE&gt;
&lt;P&gt;Check if there were repeat call and they were the first one to take the call:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FirstCallTakerwithRepeatCalls = COUNTROWS(FILTER('Table', [NoOfCallsbyNumberLaterOn] &amp;gt; 0 &amp;amp;&amp;amp; [OrderOfCallTakers] = 1))&lt;/LI-CODE&gt;
&lt;P&gt;Finally, per call taker count how many instances they had where they were the first one to take the call and the customer called again later (within the set time frame):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;NoOfRepeatCalls = COUNTX('Table',[FirstCallTakerwithRepeatCalls])&lt;/LI-CODE&gt;
&lt;P&gt;Hope it helps.&lt;/P&gt;
&lt;P&gt;Kind regards, Steve.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;file is attached.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 05:58:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-repeat-values-based-on-criteria/m-p/1679879#M34455</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2021-02-22T05:58:11Z</dc:date>
    </item>
  </channel>
</rss>

