Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Caseyc1983
Frequent Visitor

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 5
danno
Resolver V
Resolver V

@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

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

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

This is fantastic, thank you very much.  I am pretty much there but I wonder if there is a way of only pulling back repeat calls which only have a unique call ID?  Some repeat calls that come through have multiples of the same call ID (agents not answering phones and call bouncing to next available agent) and I don't want to count these.   Really appreciate all your help.

Greg_Deckler
Super User
Super User

Very difficult to troubleshoot without sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

That said, see my series on performance tuning DAX: https://community.powerbi.com/t5/Community-Blog/Performance-Tuning-DAX-Part-1/ba-p/976275


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.