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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
ashaikh
Helper III
Helper III

Count of Agents Login

Hello All,

 

I have a table which says when we get a call and a table with Agent Login Time and Logout Time

CallTable :

    CallId | CallTime            |
    1      | 2019-04-01 09:00 AM |
    2      | 2019-04-01 09:30 AM |

AgentLoginLogout :

    Date       | AgentId | LoginTime          | LogoutTime          | AgentTeam |
    2019-04-01 | 1       | 2019-04-03 3:00 AM | 2019-04-03 10:00 AM | TeamA     |
2019-04-01 | 2 | 2019-04-03 9:15 AM | 2019-04-03 5:15 PM | TeamA |
2019-04-01 | 3 | 2019-04-03 9:15 AM | 2019-04-03 5:15 PM | TeamB |

So what I want to calculate is how many agents are logged in when each call came in. Final result will look like below

FinalResult :

    CallId | CallTime            | AgentsOnline
    1      | 2019-04-01 09:00 AM | 1
    2      | 2019-04-01 09:30 AM | 2

Thanks in Advance

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@ashaikh 

 

Try this calculated column

 

AgentsOnline =
COUNTROWS (
    FILTER (
        AgentLoginLogout,
        CallTable[CallTime] >= AgentLoginLogout[LoginTime]
            && CallTable[CallTime] <= AgentLoginLogout[LogoutTime]
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@ashaikh 

 

Try this calculated column

 

AgentsOnline =
COUNTROWS (
    FILTER (
        AgentLoginLogout,
        CallTable[CallTime] >= AgentLoginLogout[LoginTime]
            && CallTable[CallTime] <= AgentLoginLogout[LogoutTime]
    )
)

Regards
Zubair

Please try my custom visuals

@Zubair_Muhammad I am trying  to use this query and I am just getting working on it...

 

And its taking long time to execute I guess. Is there any other way to do it.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors