Forum Discussion
Measure to count calls in each queue
- Anonymous4 years ago
Hi Anonymous ,
Here I create a sample to have a test.
When I try you code to create [Answered incl. call-backs] and [Offered calls] measures, I can reproduce your issue. Both measures will show total when I add [Queue_key] into the visual and show correct result when I add [Queue_display] into the visual. I think this should be caused by you use [Queue_key] <>BLANK() as independent filter. This seems to remove the filter of [Queue_key]. I suggest you to try codes as below.
Offered calls = CALCULATE ( COUNT ( Calls[call_id] ), FILTER ( Calls, Calls[Queue_key] <> BLANK () && OR ( AND ( Calls[Event_type] = "c", Calls[Callback_in_queue] <> "c" ), AND ( Calls[Callback_in_queue] = "a", Calls[Result_code] <> "t" ) ) ) )Answered incl. call-backs = CALCULATE ( COUNT ( Calls[call_id] ), FILTER ( Calls, Calls[Event_type] = "c" && Calls[Result_code] = "k" && Calls[Callback_in_queue] <> "a" && Calls[Queue_key] <> BLANK () ) )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Here I create a sample to have a test.
When I try you code to create [Answered incl. call-backs] and [Offered calls] measures, I can reproduce your issue. Both measures will show total when I add [Queue_key] into the visual and show correct result when I add [Queue_display] into the visual. I think this should be caused by you use [Queue_key] <>BLANK() as independent filter. This seems to remove the filter of [Queue_key]. I suggest you to try codes as below.
Offered calls =
CALCULATE (
COUNT ( Calls[call_id] ),
FILTER (
Calls,
Calls[Queue_key] <> BLANK ()
&& OR (
AND ( Calls[Event_type] = "c", Calls[Callback_in_queue] <> "c" ),
AND ( Calls[Callback_in_queue] = "a", Calls[Result_code] <> "t" )
)
)
)Answered incl. call-backs =
CALCULATE (
COUNT ( Calls[call_id] ),
FILTER (
Calls,
Calls[Event_type] = "c"
&& Calls[Result_code] = "k"
&& Calls[Callback_in_queue] <> "a"
&& Calls[Queue_key] <> BLANK ()
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you, I feel like I tried just everything. Never had anything like this before.