Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
I have phone_numbers that were called over time, how often they were called and the duration of each call.
I need two calculations:
1) Top 10 most called numbers by number of calls received
2) Top 10 most called numbers by duration of call
the varibles I have: Phone_Number , date, call_duration
What DAX can I write to resolve these two calculations?
For Question 1) Top 10 most called numbers by number of calls received: I tried:
Top 10 can be resolved with the filter.
CNT Calls =
CALCULATE (
DISTINCTCOUNT( table[Phone_Number]),
FILTER ( table, table[date])
)
What do I need to change as my count is not correct. The date? How can I write this?
For Question 2) Top 10 most often called numbers by duration of call: I tried:
Top 10 can be resolved with the filter.
CNT of Calls by Duration=
COUNT(
DISTINCTCOUNT( table[Phone_Number]),
FILTER ( table, table[duration])
)
What do I need to change to get the calls by duration?
How can I implement a second filter, say I want only County= AUS ?
Thank you, I am still new to DAX and still find it challenging to get used to.
Solved! Go to Solution.
@acg , TRy measures like these
calls = count( table[Phone_Number])
Total Duration = Sum(table[duration])
TOP 10 by call = calculate([calls],TOPN(4,allselected(table[Phone_Number]),[calls],DESC), values(table[Phone_Number]))
Top 10 by duration = calculate([Total Duration],TOPN(4,allselected(table[Phone_Number]),[Total Duration ],DESC), values(table[Phone_Number]))
@acg , TRy measures like these
calls = count( table[Phone_Number])
Total Duration = Sum(table[duration])
TOP 10 by call = calculate([calls],TOPN(4,allselected(table[Phone_Number]),[calls],DESC), values(table[Phone_Number]))
Top 10 by duration = calculate([Total Duration],TOPN(4,allselected(table[Phone_Number]),[Total Duration ],DESC), values(table[Phone_Number]))
@amitchandak I am having trouble to incorporate the Measure: CNT To_Person
and receive the mistake as below. Is the measure at the right place?
User | Count |
---|---|
11 | |
9 | |
6 | |
5 | |
4 |