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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jcawley
Helper III
Helper III

Count of Possible Calls

Good morning,

I'm trying to find the count of phone calls a user could've answered. I've had this work successfully using calculated columns. But I'd like to avoid that if a measure is possible.

Let's say we are looking at user 'Jessica' and want to know how many possible calls they could've taken. This should be all calls they either took (user = Jessica, call type = inbound) or passed up that were inbound, the call was to the same answer location, and they were not busy on the phone during that time.

So using the following table:

Call DateUserCall TimeCall End TimeDurationCall TypeAnswer Location
12/5/2023Jessica8:57:52 AM8:58:49 AM0:00:57Inbound1
12/5/2023Sheena8:58:11 AM8:58:25 AM0:00:14Inbound2
12/5/2023Whitney8:58:18 AM9:00:46 AM0:02:28Internal2
12/5/2023 8:58:31 AM8:59:32 AM0:01:01Outbound2
12/5/2023 8:58:37 AM9:02:25 AM0:03:48Outbound1
12/5/2023 8:58:47 AM9:00:15 AM0:01:28Outbound1
12/5/2023 8:59:26 AM9:00:49 AM0:01:23Inbound2
12/5/2023 8:59:34 AM9:00:59 AM0:01:25Inbound1
12/5/2023 8:59:36 AM9:02:31 AM0:02:55Inbound1
12/5/2023 8:59:37 AM9:00:37 AM0:01:00Outbound2
12/5/2023 8:59:51 AM9:01:38 AM0:01:47Outbound2
12/5/2023Jessica9:00:11 AM9:02:55 AM0:02:44Inbound1
12/5/2023Tatyana9:00:12 AM9:05:43 AM0:05:31Inbound2
12/5/2023 9:00:26 AM9:03:29 AM0:03:03Outbound2
12/5/2023 9:00:41 AM9:37:45 AM0:37:04Outbound2
12/5/2023 9:00:57 AM9:03:58 AM0:03:01Outbound2
12/5/2023Angelica9:00:57 AM9:04:03 AM0:03:06Inbound1
12/5/2023 9:01:21 AM9:03:13 AM0:01:52Internal1

 

I would see that Jessica could've answered the phone 4 times. She answered twice (green text), and had two calls that went unanswered (red text) where they were not on another phone call.

Is this possible? Any help would be greatly appreciated!

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @jcawley,

You can try to use the following measure formula to calculate the call counts based on groups:

formula = 
VAR currUser =
    SELECTEDVALUE ( 'Table'[User] )
VAR currStart =
    MAX ( 'Table'[Call Time] )
VAR currEnd =
    MAX ( 'Table'[Call End Time] )
VAR answered =
    CALCULATE (
        COUNT ( 'Table'[Call Date] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            [Call Time] <= currStart
                && [User] = currUser
        ),
        VALUES ( 'Table'[Call Date] ),
        VALUES ( 'Table'[Call Type] ),
        VALUES ( 'Table'[Answer Location] )
    )
VAR notanswered =
    CALCULATE (
        COUNT ( 'Table'[Call Date] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            [Call Time] <= currStart
                && OR ( [Call Time] <= currEnd, [Call End Time] >= currStart )
                && [User] = ""
        ),
        VALUES ( 'Table'[Call Date] ),
        VALUES ( 'Table'[Call Type] ),
        VALUES ( 'Table'[Answer Location] )
    )
RETURN
    answered + notanswered

1.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you for the attempt! This does not quite work though.

The first variable works like a charm! The problem lies in the second part which I suppose is most of the problem. 

I've added more users to this table:

https://docs.google.com/spreadsheets/d/1Wh24yBd7a1ZqrRMphKQgPa8io4dZe_tTerLfe9wwdlo/edit#gid=0

The code sort of works, but it needs to be dependent on location and whether or not the call is inbound.

Location must equal location (in this instance 1) and a call can't be missed if it was outbound or internal, so only a missed inbound would count!

Any additional help would be greatly appreciated!

I think one big thing I left out is user location. For this Example "Jessica" is associated with location 1 only, not 2.

@v-shex-msft We really appreciate your help and if there is anyway you could give this a second look we would forever gratefull!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.