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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Caseyc1983
Frequent Visitor

Total Calls for repeated telephone numbers

Hello,

 

I am looking to find a calculation that will give me a value for the total number of calls per day, week, month, from telephone numbers which have contacted us on more than one occassion.  My table list all calls by date, telephone number, and a unique call reference number.   Total should exclude calls from customers who have only contacted us once during the timeframe specified.  Any help would be much appreciated.

 

IDDateTelephone Number
104/11/201912345
204/11/201913246
304/11/201912222
404/11/201912345
504/11/201912345
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Caseyc1983 , 

 

the first question can be covered with the measure like: 

 

M2 = 
var ValidCalls = Filter(Calls,Not Calls[callerid] IN {"Anonymous", "Withheld", "Private"})
var tablevar =
SUMMARIZE(
ValidCalls,
Calls[callerid],
"TC", sumx(Calls, if (COUNTROWS('Calls')>1,1,0)
) )
return
SUMX(tablevar, [TC])

The first parameter of Summarize exepts a table. If you change the ValidCalls varible you can control the table that is used by the summarize statement. 

DistinctCustomers per period is basically an additional wrapper around the summarize command:

M3 = 
var ValidCalls = Filter(Calls,Not Calls[callerid] IN {"Anonymous", "Withheld", "Private"})
var NumberOfDistinctCustomers =
COUNTROWS (
filter (
    ADDCOLUMNS (
        SUMMARIZE (
     ValidCalls,
     Calls[callerid]),
"TC", CALCULATE(sumx(Calls, if (COUNTROWS('Calls')>1,1,0)))
    ) ,
    [TC]>0)
    )
return
NumberOfDistinctCustomers

 Give it a try

 

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Caseyc1983 , 

 

the first question can be covered with the measure like: 

 

M2 = 
var ValidCalls = Filter(Calls,Not Calls[callerid] IN {"Anonymous", "Withheld", "Private"})
var tablevar =
SUMMARIZE(
ValidCalls,
Calls[callerid],
"TC", sumx(Calls, if (COUNTROWS('Calls')>1,1,0)
) )
return
SUMX(tablevar, [TC])

The first parameter of Summarize exepts a table. If you change the ValidCalls varible you can control the table that is used by the summarize statement. 

DistinctCustomers per period is basically an additional wrapper around the summarize command:

M3 = 
var ValidCalls = Filter(Calls,Not Calls[callerid] IN {"Anonymous", "Withheld", "Private"})
var NumberOfDistinctCustomers =
COUNTROWS (
filter (
    ADDCOLUMNS (
        SUMMARIZE (
     ValidCalls,
     Calls[callerid]),
"TC", CALCULATE(sumx(Calls, if (COUNTROWS('Calls')>1,1,0)))
    ) ,
    [TC]>0)
    )
return
NumberOfDistinctCustomers

 Give it a try

 

 

Sorry to be a pain but how would I add 'is not blank' to those filters as well.

 

thanks 

Just ignore that, figured it out.  Just being daft!

Thank you so much guys, you're help is much appreciated!!!!

Anonymous
Not applicable

Hi @Caseyc1983 , 

 

This measure works for me, but only in a matrix, where the timeframe is still part of the evaluation context.

 

Telephone Calls excl 1.jpg

My Measure:
 
M1 :=
var tablevar =  SUMMARIZE(
Calls,
Calls[callerid]
, "TC", sumx(Calls, if (COUNTROWS('Calls')>1,1,0)
)
)
return
SUMX(tablevar, [TC])
 
Hope this helps, if not then I am also interested in the final solution 🙂
 
regards,
 
Jan

Thank you so much for this, worked a treat.  Is there anyway of applying some form of filter to this calculation in order to exclude any calls from numbers which are witheld or anonymous?   Likewise, do you have a solution which counts the distinct number of customers who have called more than once on a given day, week or month?  This would also need to have the ability to filter / exclude certain things such as witheld numbers

 

Really appreciate you getting back to me!!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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