Forum Discussion

Banshee's avatar
Banshee
Frequent Visitor
2 years ago
Solved

Dax for Dynamic Average of Filtered Column

I have  a table with wait time duration in seconds 

 

I'm using the following formula to get the average wait for all calls using the slicer dates:  

Average Inbound Wait Time = VAR AvgSec = calculate(AVERAGEX('Calls', [QueueDuration - seconds]),ALLSELECTED(' Calls'[Date]))

 VAR AvgHr = DIVIDE(avgsec, 86400)

 RETURN
 FORMAT(AvgHr,  "hh:mm:ss")
 
How do I introduce a filter for calltype so that i can just get an average for inbound calls?
 
Thanks
  • 1.

     

     

    VAR AvgSec = calculate(AVERAGE('Calls'[QueueDuration - seconds]),ALLSELECTED(' Calls'[Date]),'Calls'[CallType']="Inbound")

     

     

    2. 

     

     

    RETURN
     FORMAT(AvgHr,  "hh:mm:ss")

     

     

    will return the wrong result if the average is over 24 hours.  Hopefully that is only a hypothetical issue.

1 Reply

  • 1.

     

     

    VAR AvgSec = calculate(AVERAGE('Calls'[QueueDuration - seconds]),ALLSELECTED(' Calls'[Date]),'Calls'[CallType']="Inbound")

     

     

    2. 

     

     

    RETURN
     FORMAT(AvgHr,  "hh:mm:ss")

     

     

    will return the wrong result if the average is over 24 hours.  Hopefully that is only a hypothetical issue.