The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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?