Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure to count calls in each queue

My measure doesn't split by the rows.  I only have one table in my model, so it has nothing to do with relationships. The total count I'm getting is correct. It just doesn't show a sub-count...
  • Anonymous's avatar
    Anonymous
    4 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 Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.