Forum Discussion

Caseyc1983's avatar
Caseyc1983
Frequent Visitor
6 years ago

Tracking repeat callers per day based on distinct call ID

I currently have a table which list all calls received each day into a contact centre and from this I am looking to pull out data relating to the number of repeat customers (distinct telephone numbers) who called on daily basis & of those calls, how many times did those particular repeat customers call on each given day.  I currently have the following DAX which works to an extent  but is causing memory failure error and I am looking for a workaround for this if possible?  I am also looking to see if we can adapt the 2nd dax measure to only bring back total calls from repeat callers based on a distinct call ID but I am struggling to incorporate this into the measure so any help would be much appreciated.   Thanks 

 

No Distinct Repeat Callers =
var ValidCalls = FILTER('Repeat Callers',Not 'Repeat Callers'[Originator DN (Calling Number)] IN {"Anonymous", "Withheld", BLANK()})
var NumberOfRepeatCustomers =
COUNTROWS (
filter (
ADDCOLUMNS (
SUMMARIZE (
ValidCalls,
'Repeat Callers'[Originator DN (Calling Number)]),
"TC", CALCULATE(sumx('Repeat Callers', if (COUNTROWS('Repeat Callers')>1,1,0)))
) ,
[TC]>0)
)
return
NumberOfRepeatCustomers
 
Repeat Callers - Total Calls =
var ValidCalls = Filter('Repeat Callers',Not 'Repeat Callers'[Originator DN (Calling Number)] IN {"Anonymous", "Withheld", "Private",BLANK()})
var tablevar =
SUMMARIZE(
ValidCalls,
'Repeat Callers'[Originator DN (Calling Number)],
"TC", sumx('Repeat Callers', if (COUNTROWS('Repeat Callers')>1,1,0)
) )
return
SUMX(tablevar, [TC])
 

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Caseyc1983  It looks like there is a lot going on inside your measures, including a lot of iterative functions.  I would suggest creating summarised calculated tables at the required level of granularity, rather than trying to calculate these measures on the fly, that way the calculations are pushed down into the model refresh, rather than being done while the report is running.  
    If you need to indicate which callers are repeat callers, you could put this logic into a calculated column, again this would push some of the logic into the model refresh, rather than doing is all in the measure. 

    Let me know if this helps

    • Caseyc1983's avatar
      Caseyc1983
      Frequent Visitor

      Thank you so much for the reply guys.  I like the idea of pushing this into a refresh summarised calculated table, can you give me an idea of  how I would go about doing this as it is not something I have done before.  To give you a rough idea of what the data would look like, I have put a small table below.  The actual dataset is made up of over a million lines at present.

       

      DateCall IDTelephone NumberQueue 
      01/01/201234566666666666Queue 1
      01/01/201234666666668888Queue 2
      01/01/201234766666666898Queue 2
      01/01/201234866666666666Queue 2
      01/01/201234966666666666Queue 3
      01/01/201235066666666669Queue 1
      02/01/201235155555555554Queue 1
      02/01/201235288888888881Queue 2
      • Anonymous's avatar
        Anonymous
        Not applicable

        You can sumarise callers into a smaller table using this table expression: 

        Repeat Callers = FILTER(SUMMARIZECOLUMNS(Calls[Telephone Number], "Calls", COUNTROWS(Calls)), [Calls] > 1)
        you could then use the numbers in this table combined with a measure for the number of calls to report on repeat callers in a single day. 
        Repeat Callers = COUNTROWS('Repeat Callers')
        Calls = COUNTROWS('Calls')
         
        please mark this as a solution if it has helped you