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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
AllisonB
Frequent Visitor

measure to calculate the sum of calls made by phone numbers that have called 6 or more times

Hello

 

I'm trying to produce a measure that will calculate the sum of calls made by phone numbers that have called 6 or more times, I thought about maybe using VAR to create a virtual table of the count of each phone number and then filter that so its sums the ones with a count of 6 or more but I've not been able to get that to work but that could be due to my lack of knowledge in writing DAX. I need this measure to interact with a date slicer and to be able to use it to calculate the result as a percentage of all calls.

These are the columns in the data set

AllisonB_0-1741948655770.png

 

I've been able to create a visulization that gets me what I need, so I know what the outcome of the measure should be, this is just a count of the calling number with a filter to only show counts equal to or greater than 6, so essencially I need to recreate this table as a measure

AllisonB_1-1741948761635.png

 

Thanks in advance for your assistance

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a measure like

Num calls ( 6 or more ) =
VAR NumbersAndCalls =
    ADDCOLUMNS (
        VALUES ( 'Table'[Calling No] ),
        "@num calls", CALCULATE ( COUNTROWS ( 'Table' ) )
    )
VAR Result =
    SUMX ( FILTER ( NumbersAndCalls, [@num calls] >= 6 ), [@num calls] )
RETURN
    Result

and to show the % 

Num calls ( 6 or more ) % =
DIVIDE ( [Num calls ( 6 or more )], COUNTROWS ( 'Table' ) )

View solution in original post

3 REPLIES 3
bhanu_gautam
Super User
Super User

@AllisonB Measure to count the number of calls per phone number:

CallsPerPhoneNumber =
CALCULATE(
COUNTROWS('YourTable'),
ALLEXCEPT('YourTable', 'YourTable'[Calling No])
)

 

Measure to filter and sum the calls for phone numbers with 6 or more calls:

SumOfCallsByFrequentCallers =
CALCULATE(
SUM('YourTable'[Duration]),
FILTER(
ADDCOLUMNS(
SUMMARIZE('YourTable', 'YourTable'[Calling No]),
"CallCount", [CallsPerPhoneNumber]
),
[CallCount] >= 6
)
)

 

Measure to calculate the percentage of these calls relative to all calls:

PercentageOfFrequentCalls =
DIVIDE(
[SumOfCallsByFrequentCallers],
SUM('YourTable'[Duration]),
0
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






johnt75
Super User
Super User

You could create a measure like

Num calls ( 6 or more ) =
VAR NumbersAndCalls =
    ADDCOLUMNS (
        VALUES ( 'Table'[Calling No] ),
        "@num calls", CALCULATE ( COUNTROWS ( 'Table' ) )
    )
VAR Result =
    SUMX ( FILTER ( NumbersAndCalls, [@num calls] >= 6 ), [@num calls] )
RETURN
    Result

and to show the % 

Num calls ( 6 or more ) % =
DIVIDE ( [Num calls ( 6 or more )], COUNTROWS ( 'Table' ) )

@johnt75  this worked perfectly, thank you so much and for responing so quickly

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.