Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Measure to count calls in each queue

My measure doesn't split by the rows. 

Mini_1_0-1651841630662.png


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 for each queue. I think the issue has something to do with one part of my measurement code where I filter out call_id where the queue is null.

There are both queue_key, and queue_display in my table. My two incorrect measures are using queue_key, Total calls don't have that filter part at all. 

Total calls = CALCULATE(count(Calls[call_id]), 
    Calls[Event_type]="q", 
    Calls[Result_code] <> "d")

Answered incl. call-backs = 
CALCULATE(COUNT(Calls[call_id]), 
Calls[Event_type]="c", 
Calls[Result_code] = "k", 
Calls[Callback_in_queue] <> "a", 
Calls[Queue_key] <> BLANK())


Offered calls = CALCULATE(count(Calls[call_id]), 
    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")
    )
)


Strange thing is that it works if I'm changing the column and use queue_display instead, as well as the other way around. My measure can use queue_display, but my visual table then has to use queue_key.

Mini_1_1-1651842150791.png

 

Why is this a thing and how do I fix it? I would like to only use queue_key or queue_display as they contain the same value of information. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Here I create a sample to have a test.

RicoZhou_0-1652082129819.png

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.

RicoZhou_1-1652082422628.png

 

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.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Here I create a sample to have a test.

RicoZhou_0-1652082129819.png

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.

RicoZhou_1-1652082422628.png

 

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.

Anonymous
Not applicable

Thank you, I feel like I tried just everything. Never had anything like this before. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.